Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
Stroika::Foundation::Containers Namespace Reference

Namespaces

namespace  Concrete
 
namespace  DataStructures
 
namespace  Private
 

Classes

class  Association
 An Association pairs key values with (possibly multiple or none) mapped_type values. Like Mapping<>, but allowing multiple items associated with 'key'. More...
 
class  Bijection
 Bijection allows for the bijective (1-1) association of two elements. More...
 
class  Collection
 A Collection<T> is a container to manage an un-ordered collection of items, without equality defined for T. More...
 
class  DataHyperRectangle
 
class  DenseDataHyperRectangle
 
class  Deque
 
class  KeyedCollection
 a cross between Mapping<KEY, T> and Collection<T> and Set<T> More...
 
struct  KeyedCollection_DefaultTraits
 
class  Mapping
 
class  MultiSet
 
class  Queue
 A Queue is a first-in-first-out (FIFO) data structure, where elements are arranged in well-ordered fashion, from HEAD to TAIL. More...
 
class  Sequence
 A generalization of a vector: a container whose elements are keyed by the natural numbers. More...
 
class  Set
 Set<T> is a container of T, where once an item is added, additionally adds () do nothing. More...
 
class  SortedAssociation
 
class  SortedCollection
 A SortedCollection is a Collection<T> which remains sorted (iteration produces items sorted) even as you add and remove entries. More...
 
class  SortedKeyedCollection
 A SortedKeyedCollection is a KeyedCollection<T> which remains sorted (iteration produces items sorted) even as you add and remove entries. More...
 
class  SortedMapping
 
class  SortedMultiSet
 
class  SortedSet
 
class  SparseDataHyperRectangle
 
class  Stack
 

Concepts

concept  IKeyedCollection_ExtractorCanBeDefaulted
 
concept  Mapping_IKey
 document requirements for a Mapping key
 
concept  Mapping_IMappedValue
 document requirements for a Mapping value
 

Typedefs

template<typename T , size_t N>
using DataHyperRectangleN = typename Private_DataHyperRectangle_::template NTemplate< T, DataHyperRectangle >::template Helper_< make_index_sequence< N > >::CombinedType
 
template<typename T , size_t N>
using DenseDataHyperRectangleN = typename Private_DataHyperRectangle_::template NTemplate< T, DenseDataHyperRectangle >::template Helper_< make_index_sequence< N > >::CombinedType
 
template<typename T , size_t N>
using SparseDataHyperRectangleN = typename Private_DataHyperRectangle_::template NTemplate< T, SparseDataHyperRectangle >::template Helper_< make_index_sequence< N > >::CombinedType
 

Enumerations

enum class  AddReplaceMode { eAddIfMissing , eAddReplaces }
 Mode flag to say if Adding to a container replaces, or if the first addition wins. More...
 
enum class  AddOrExtendOrReplaceMode { eAddIfMissing = static_cast<int> (AddReplaceMode::eAddIfMissing) , eAddReplaces = static_cast<int> (AddReplaceMode::eAddReplaces) , eAddExtras , eDuplicatesRejected }
 Mode flag to say if Adding to a container replaces, or if the first addition wins (Logically AddOrExtendOrReplaceMode subclasses AddReplaceMode) More...
 

Functions

template<typename T >
Collection< T > operator+ (const Iterable< T > &lhs, const Collection< T > &rhs)
 
template<typename CONTAINER >
CONTAINER::value_type * Start (CONTAINER &c)
 For a contiguous container (such as a vector or basic_string) - find the pointer to the start of the container.
 
template<typename CONTAINER >
CONTAINER::value_type * End (CONTAINER &c)
 For a contiguous container (such as a vector or basic_string) - find the pointer to the end of the container.
 
template<typename T >
Sequence< T > operator+ (const Iterable< T > &lhs, const Sequence< T > &rhs)
 
template<typename T >
Set< T > operator+ (const Set< T > &lhs, const Iterable< T > &rhs)
 
template<typename T >
Set< T > operator- (const Set< T > &lhs, const Iterable< T > &rhs)
 
template<typename T >
Set< T > operator^ (const Set< T > &lhs, const Iterable< T > &rhs)
 

Detailed Description

Note
Code-Status: Beta

TODO:

Or add Bag<> class that does basically this.

STATUS: NOT EVEN DRAFT IMPL READY YET TO TEST.

Note
Code-Status: Draft – CODE NO WHERE NEAR COMPILING - just rough draft of API based on 1992 Stroika...

TODO:

@todo   Use TRAITS mechanism - like with Bag<>

@todo   Implement first draft of code based on
        http://github.com/SophistSolutions/Stroika/blob/master/Archive/Stroika_FINAL_for_STERL_1992/Library/Foundation/Headers/PriorityQueue.hh

@todo   FIX so can remove top prioty itme to return btoih at a time.

@todo   Add Traits, and part of triats is priority type.
        min/max comes from numeric_limits<T>::min/max, and memmbers of the traits - not global

@todo   Rename PQEntry to PriorityQueueEntry
        (document why not nested type, and why not using pair<> - and then put docs into MultiSet code,
        and then redo Mapping to use KeyValuePair<> instead of pair<> - and have .fKey first elt!

@todo   redo operator== (const PQEntry<T>& lhs, const PQEntry<T>& rhs); as member function
Note
Code-Status: Beta

TODO:

Note
Code-Status: Beta
Code-Status: Beta

TODO:

Typedef Documentation

◆ DataHyperRectangleN

template<typename T , size_t N>
using Stroika::Foundation::Containers::DataHyperRectangleN = typedef typename Private_DataHyperRectangle_::template NTemplate<T, DataHyperRectangle>::template Helper_<make_index_sequence<N> >::CombinedType

using DataHyperRectangleN = DataHyperRectangle<T, size_t N REPEATED TIMES>

Definition at line 207 of file DataHyperRectangle.h.

◆ DenseDataHyperRectangleN

template<typename T , size_t N>
using Stroika::Foundation::Containers::DenseDataHyperRectangleN = typedef typename Private_DataHyperRectangle_::template NTemplate<T, DenseDataHyperRectangle>::template Helper_<make_index_sequence<N> >::CombinedType

using DenseDataHyperRectangleN = DenseDataHyperRectangle<T, size_t REPEATED N TIMES>

Definition at line 63 of file DenseDataHyperRectangle.h.

◆ SparseDataHyperRectangleN

template<typename T , size_t N>
using Stroika::Foundation::Containers::SparseDataHyperRectangleN = typedef typename Private_DataHyperRectangle_::template NTemplate<T, SparseDataHyperRectangle>::template Helper_<make_index_sequence<N> >::CombinedType

using SparseDataHyperRectangleN = SparseDataHyperRectangle<T, size_t REPEATED N TIMES>

Definition at line 67 of file SparseDataHyperRectangle.h.

Enumeration Type Documentation

◆ AddReplaceMode

Mode flag to say if Adding to a container replaces, or if the first addition wins.

See also
also AddOrExtendOrReplaceMode
Enumerator
eAddIfMissing 

Associate argument value iff key argument missing

eAddReplaces 

Associate argument with value unconditionally

Definition at line 45 of file Foundation/Containers/Common.h.

◆ AddOrExtendOrReplaceMode

Mode flag to say if Adding to a container replaces, or if the first addition wins (Logically AddOrExtendOrReplaceMode subclasses AddReplaceMode)

See also
also AddReplaceMode
Enumerator
eAddIfMissing 

same value as AddReplaceMode::eAddIfMissing

eAddReplaces 

same value as AddReplaceMode::eAddReplaces

eAddExtras 

Used in multisets (where key can be associated with multiple values) - just add extra values.

eDuplicatesRejected 

if key already present, throw runtime exception

Definition at line 62 of file Foundation/Containers/Common.h.

Function Documentation

◆ operator+() [1/3]

template<typename T >
Collection< T > Stroika::Foundation::Containers::operator+ ( const Iterable< T > &  lhs,
const Collection< T > &  rhs 
)

Basic operator overload with the obvious meaning (Collection<T> copy and Collection<T>::AddAll)

Definition at line 285 of file Containers/Collection.inl.

◆ Start()

template<typename CONTAINER >
CONTAINER::value_type * Stroika::Foundation::Containers::Start ( CONTAINER &  c)

For a contiguous container (such as a vector or basic_string) - find the pointer to the start of the container.

For a contiguous container (such as a vector or basic_string) - find the pointer to the start of the container

Note: this is like std::begin(), except that it returns a pointer, not an iterator, and returns nullptr if the container is empty.

Definition at line 23 of file Foundation/Containers/Common.inl.

◆ End()

template<typename CONTAINER >
CONTAINER::value_type * Stroika::Foundation::Containers::End ( CONTAINER &  c)

For a contiguous container (such as a vector or basic_string) - find the pointer to the end of the container.

For a contiguous container (such as a vector or basic_string) - find the pointer to the end of the container

Note: this is like std::end(), except that it returns a pointer, not an iterator, and returns nullptr if the container is empty.

Definition at line 41 of file Foundation/Containers/Common.inl.

◆ operator+() [2/3]

template<typename T >
Sequence< T > Stroika::Foundation::Containers::operator+ ( const Iterable< T > &  lhs,
const Sequence< T > &  rhs 
)

Basic operator overload with the obvious meaning (Sequence<T> copy and Sequence<T>::AppendAll)

Definition at line 517 of file Sequence.inl.

◆ operator+() [3/3]

template<typename T >
Set< T > Stroika::Foundation::Containers::operator+ ( const Set< T > &  lhs,
const Iterable< T > &  rhs 
)
Aliases
Set<>::Union

Definition at line 599 of file Set.inl.

◆ operator-()

template<typename T >
Set< T > Stroika::Foundation::Containers::operator- ( const Set< T > &  lhs,
const Iterable< T > &  rhs 
)
Aliases
Set<>::Difference.

Definition at line 609 of file Set.inl.

◆ operator^()

template<typename T >
Set< T > Stroika::Foundation::Containers::operator^ ( const Set< T > &  lhs,
const Iterable< T > &  rhs 
)
Aliases
Set<>::Intersection.

Definition at line 619 of file Set.inl.