Molassembler  3.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Scine::Molassembler::Temple::DynamicSet< T, nItems, LessThanPredicate, EqualityPredicate > Class Template Reference

Tree-based set. More...

#include <DynamicSet.h>

Inheritance diagram for Scine::Molassembler::Temple::DynamicSet< T, nItems, LessThanPredicate, EqualityPredicate >:

Public Types

using const_iterator = typename TreeType::const_iterator
 

Public Member Functions

constexpr DynamicSet ()=default
 Dynamic set.
 
template<template< typename, size_t > class ArrayType, size_t size>
constexpr DynamicSet (const ArrayType< T, size > &items)
 Constructor from existing ordered data. More...
 
PURITY_WEAK constexpr bool contains (const T &item) const
 Check if the set contains an element. More...
 
constexpr void insert (const T &item)
 Insertion an element into the set. More...
 
PURITY_WEAK constexpr Optional
< const T & > 
getOption (const T &item) const
 
constexpr void clear ()
 Remove all elements of the set.
 
PURITY_WEAK constexpr
const_iterator 
begin () const
 
PURITY_WEAK constexpr
const_iterator 
end () const
 
PURITY_WEAK constexpr size_t size () const
 
PURITY_WEAK constexpr bool operator== (const DynamicSet &other) const
 
PURITY_WEAK constexpr bool operator!= (const DynamicSet &other) const
 
PURITY_WEAK constexpr bool operator< (const DynamicSet &other) const
 
PURITY_WEAK constexpr bool operator> (const DynamicSet &other) const
 

Private Types

using TreeType = BTree< T, 3, nItems, LessThanPredicate, EqualityPredicate >
 

Private Attributes

TreeType tree_
 

Detailed Description

template<typename T, size_t nItems, class LessThanPredicate = std::less<T>, class EqualityPredicate = std::equal_to<T>>
class Scine::Molassembler::Temple::DynamicSet< T, nItems, LessThanPredicate, EqualityPredicate >

Tree-based set.

Template Parameters
TValue type of the set
nItemsMaximum number of items to store in the set
LessThanPredicate

Constructor & Destructor Documentation

template<typename T, size_t nItems, class LessThanPredicate = std::less<T>, class EqualityPredicate = std::equal_to<T>>
template<template< typename, size_t > class ArrayType, size_t size>
constexpr Scine::Molassembler::Temple::DynamicSet< T, nItems, LessThanPredicate, EqualityPredicate >::DynamicSet ( const ArrayType< T, size > &  items)
inline

Constructor from existing ordered data.

Warning: These constructors expect ordered arrays!

Member Function Documentation

template<typename T, size_t nItems, class LessThanPredicate = std::less<T>, class EqualityPredicate = std::equal_to<T>>
PURITY_WEAK constexpr bool Scine::Molassembler::Temple::DynamicSet< T, nItems, LessThanPredicate, EqualityPredicate >::contains ( const T &  item) const
inline

Check if the set contains an element.

Complexity \(\Theta(N \log N)\)

template<typename T, size_t nItems, class LessThanPredicate = std::less<T>, class EqualityPredicate = std::equal_to<T>>
constexpr void Scine::Molassembler::Temple::DynamicSet< T, nItems, LessThanPredicate, EqualityPredicate >::insert ( const T &  item)
inline

Insertion an element into the set.

Complexity \(\Theta(N \log N)\)


The documentation for this class was generated from the following file: