Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
Extension Class Reference

#include "lib/path-array.hpp"

Description

Heap-allocated extension storage for an immutable sequence of literal strings.

The size of the allocation is determined and fixed once, at construction time, derived from the number of initialisers. The first slot within the allocation stores this length. Extension can be empty (default constructed), in which case no heap allocation is performed.

Definition at line 74 of file path-array.hpp.

Public Member Functions

 ~Extension ()
 
 Extension () noexcept
 
template<typename... ELMS>
 Extension (ELMS &&...elms)
 
 Extension (Extension const &r)
 
 Extension (Extension &&rr) noexcept
 
Extensionoperator= (Extension o)
 
 operator bool () const
 
bool empty () const
 
size_t size () const
 
Literal const & operator[] (size_t idx) const
 
size_t indexOf (Literal const *pos) const
 
bool isValid (Literal const *pos) const
 
void resizeTo (size_t cnt)
 

Private Types

using PStorage = Literal *
 

Private Member Functions

PStorage newCopy () const
 allocate a copy.
 

Static Private Member Functions

static size_t & size (PStorage &p)
 

Private Attributes

PStorage storage_
 

Constructor & Destructor Documentation

◆ ~Extension()

~Extension ( )
inline

Definition at line 103 of file path-array.hpp.

References Extension::storage_.

◆ Extension() [1/4]

Extension ( )
inlinenoexcept

Definition at line 109 of file path-array.hpp.

◆ Extension() [2/4]

template<typename... ELMS>
Extension ( ELMS &&...  elms)
inlineexplicit

Definition at line 115 of file path-array.hpp.

References Extension::size(), and Extension::storage_.

+ Here is the call graph for this function:

◆ Extension() [3/4]

Extension ( Extension const &  r)
inline

Definition at line 122 of file path-array.hpp.

◆ Extension() [4/4]

Extension ( Extension &&  rr)
inlinenoexcept

Definition at line 126 of file path-array.hpp.

Member Typedef Documentation

◆ PStorage

using PStorage = Literal*
private

Definition at line 76 of file path-array.hpp.

Member Function Documentation

◆ size() [1/2]

static size_t & size ( PStorage p)
inlinestaticprivate

Definition at line 82 of file path-array.hpp.

Referenced by PathArray< chunk_size >::expandPosition(), PathArray< chunk_size >::getPosition(), PathArray< chunk_size >::normalise(), PathArray< chunk_size >::size(), and PathArray< chunk_size >::truncateTo().

+ Here is the caller graph for this function:

◆ newCopy()

PStorage newCopy ( ) const
inlineprivate

allocate a copy.

Note
caller has to manage the allocated memory
Warning
call to Literal's ctor deliberately elided

Definition at line 93 of file path-array.hpp.

References Extension::size(), and Extension::storage_.

+ Here is the call graph for this function:

◆ operator=()

Extension & operator= ( Extension  o)
inline

Definition at line 133 of file path-array.hpp.

References Extension::storage_.

◆ operator bool()

operator bool ( ) const
inline

Definition at line 141 of file path-array.hpp.

References Extension::empty().

+ Here is the call graph for this function:

◆ empty()

bool empty ( ) const
inline

Definition at line 142 of file path-array.hpp.

References Extension::storage_.

Referenced by Extension::operator bool().

+ Here is the caller graph for this function:

◆ size() [2/2]

size_t size ( ) const
inline

Definition at line 145 of file path-array.hpp.

References Extension::size(), and Extension::storage_.

Referenced by Extension::Extension(), Extension::isValid(), Extension::newCopy(), Extension::operator[](), Extension::resizeTo(), and Extension::size().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator[]()

Literal const & operator[] ( size_t  idx) const
inline

Definition at line 152 of file path-array.hpp.

References Extension::size(), and Extension::storage_.

+ Here is the call graph for this function:

◆ indexOf()

size_t indexOf ( Literal const *  pos) const
inline

Definition at line 159 of file path-array.hpp.

References Extension::isValid(), and Extension::storage_.

Referenced by PathArray< chunk_size >::indexOf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValid()

bool isValid ( Literal const *  pos) const
inline

Definition at line 167 of file path-array.hpp.

References Extension::size(), and Extension::storage_.

Referenced by PathArray< chunk_size >::indexOf(), Extension::indexOf(), and PathArray< chunk_size >::isValid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resizeTo()

void resizeTo ( size_t  cnt)
inline

Definition at line 175 of file path-array.hpp.

References Extension::size(), and Extension::storage_.

Referenced by PathArray< chunk_size >::expandPosition(), PathArray< chunk_size >::normalise(), and PathArray< chunk_size >::truncateTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ storage_

+ Collaboration diagram for Extension:

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