Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 83 of file path-array.hpp.

Public Member Functions

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

Private Types

using PStorage = Literal *
 

Private Member Functions

PStorage newCopy () const
 allocate a copy. More...
 

Static Private Member Functions

static size_t & size (PStorage &p)
 

Private Attributes

PStorage storage_
 

Member Typedef Documentation

using PStorage = Literal*
private

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

Constructor & Destructor Documentation

~Extension ( )
inline

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

References Extension::storage_.

Extension ( )
inlinenoexcept

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

Extension ( ELMS &&...  elms)
inlineexplicit

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

References Extension::size().

+ Here is the call graph for this function:

Extension ( Extension const &  r)
inline

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

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

+ Here is the call graph for this function:

Extension ( Extension &&  rr)
inlinenoexcept

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

Member Function Documentation

static size_t& size ( PStorage p)
inlinestaticprivate

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

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 102 of file path-array.hpp.

References Extension::size(), and util::unConst().

Referenced by Extension::Extension(), and Extension::operator=().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Extension& operator= ( Extension const &  o)
inline

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

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

+ Here is the call graph for this function:

Extension& operator= ( Extension &&  rr)
inlinenoexcept

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

operator bool ( ) const
inline

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

References Extension::empty().

+ Here is the call graph for this function:

bool empty ( ) const
inline

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

References Extension::storage_.

Referenced by Extension::operator bool().

+ Here is the caller graph for this function:

size_t size ( ) const
inline

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

References util::unConst().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References Extension::size().

+ Here is the call graph for this function:

size_t indexOf ( Literal const *  pos) const
inline

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

References Extension::isValid().

+ Here is the call graph for this function:

bool isValid ( Literal const *  pos) const
inline

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

References Extension::size(), and util::unConst().

Referenced by Extension::indexOf().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void resizeTo ( size_t  cnt)
inline

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

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

+ Here is the call graph for this function:

Member Data Documentation

+ Collaboration diagram for Extension:

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