Lumiera  0.pre.03
»edit your freedom«
lib Namespace Reference

Description

Implementation namespace for support and library code.

Namespaces

 hash
 Hash implementations usable for the HashIndexed mixin as well as key within std::unordered_map.
 
 idi
 Identification Schemes.
 
 sync
 Helpers and building blocks for Monitor based synchronisation.
 

Typedefs

typedef size_t HashVal
 a STL compatible hash value
 
typedef size_t IxID
 
typedef lumiera_uidLUID
 a Lumiera UID
 
using Random = RandomSequencer< std::mt19937_64 >
 PRNG engine to use by default: 64bit Mersenne twister.
 
using RawAddr = void const *
 
using StrView = std::string_view
 
using SubMatch = std::smatch::value_type const &
 
typedef vector< string > VectS
 

Classes

class  AddressExposingIter
 wrapper for an existing Iterator type to expose the address of each value yielded. More...
 
class  AllocationCluster
 A pile of objects sharing common allocation and lifecycle. More...
 
class  Allocator_TransferNoncopyable
 Addendum to scoped-holder.hpp for transferring the lifecycle management to another instance. More...
 
class  AllocatorHandle
 Placeholder implementation for a custom allocator. More...
 
class  AutoRegistered
 Helper mixin template for implementing a type intended to participate in automatic element tracking. More...
 
class  BuilderQualifierSupport
 Mix-in to accept and apply an arbitrary sequence of qualifier functors. More...
 
class  CallQueue
 A threadsafe queue for bound void(void) functors. More...
 
class  CappedGen
 Adapter to protect against data corruption caused by concurrent access. More...
 
class  CheckedCore
 Adapter to add sanity checks to a »state core«. More...
 
class  ClassLock
 A synchronisation protection guard employing a lock scoped to the parameter type as a whole, not an individual instance. More...
 
class  Cmdline
 Abstraction of the usual int argc, int** argv-Commandline, to be able to treat it as a vector of strings. More...
 
class  ConstIter
 wrapper to expose values as const More...
 
class  ContainerCore
 Adapter to »piggy-back« a STL iterable container inline and expose it as »state core«. More...
 
class  CustomAllocator
 Policy: use just plain heap allocations whenever you define a specialisation, you are responsible for proper alignment. More...
 
class  DelStash
 Manage a collection of deleter functions. More...
 
class  Depend
 Access point to singletons and other kinds of dependencies designated by type. More...
 
class  DependencyFactory
 Helper to abstract creation and lifecycle of a dependency. More...
 
class  DependInject
 This framework allows to (re)configure the lib::Depend front-end for dependency-injection. More...
 
class  DiagnosticContext
 Diagnostic data frame to collect specific information concerning a scope. More...
 
class  ElementTracker
 Registry for tracking object instances. More...
 
struct  EmptyBase
 
class  ExtendedSubId
 
class  ExtensibleFilterIter
 Additional capabilities for FilterIter, allowing to extend the filter condition underway. More...
 
class  FamilyMember
 Utility to produce member IDs for objects belonging to a "Family", as defined by a distinguishing type. More...
 
struct  FilterCore
 Implementation of the filter logic. More...
 
class  FilterIter
 Iterator tool filtering pulled data according to a predicate. More...
 
class  Handle
 Generic opaque reference counting handle, for accessing a service and managing its lifecycle. More...
 
struct  HashIndexed
 A Mixin to add a private ID type to the target class, together with storage to hold an instance of this ID, getter and setter, and a templated version of the ID type which can be used to pass specific subclass type info. More...
 
class  HeteroData
 A setup with chained data tuples residing in distributed storage. More...
 
class  HeteroData< meta::Node< StorageFrame< seg, DATA... >, TAIL > >
 
class  HeteroData< meta::NullType >
 
struct  IdentityCore
 A neutral identity-function core, also serving as point-of reference how any core is intended to work. More...
 
class  IncidenceCount
 A recorder for concurrent incidences. More...
 
class  IndexIter
 Subscript-index based access to a container, packaged as iterator. More...
 
class  InPlaceAnyHolder
 Inline buffer to hold and own an object while concealing the concrete type. More...
 
struct  InPlaceAnyHolder_unrelatedTypes
 Alternative policy for accessing the contents without a common interface; use this policy if the intention is to use OpaqueHolder with a family of similar classes, without requiring all of them to be derived from a common base class. More...
 
struct  InPlaceAnyHolder_useCommonBase
 Standard policy for accessing the contents via a common base class interface. More...
 
class  InPlaceBuffer
 Buffer to place and maintain an object instance privately within another object. More...
 
class  IterableDecorator
 Decorator-Adapter to make a »*State Core*« iterable as Lumiera Forward Iterator. More...
 
class  IterAdapter
 Adapter for building an implementation of the »Lumiera Forward Iterator« concept. More...
 
class  IterCursor
 A cursor-like iterator with the ability to switch iteration direction. More...
 
class  IterExplorer
 Adapter to build a demand-driven tree expanding and exploring computation based on a custom opaque state core. More...
 
struct  IterExploreSource
 Iterator front-end to manage and operate a IterExplorer pipeline opaquely. More...
 
struct  IterQueue
 A Queue which can be pulled by iterating. More...
 
class  IterSource
 Iteration source interface to abstract a data source, which then can be accessed through IterAdapter as a frontend, allowing to pull individual elements until exhaustion. More...
 
struct  IterStack
 A Stack which can be popped by iterating. More...
 
class  IterStateCore
 Adapter to dress up an existing »Lumiera Forward Iterator« as »state core«. More...
 
class  IterStateWrapper
 Another Lumiera Forward Iterator building block, based on incorporating a state type as »*State Core*«, right into the iterator. More...
 
class  IterTool
 Standard functionality to build up any iterator tool. More...
 
struct  IterType
 Helper for type rewritings: get the element type for an iterator like entity. More...
 
struct  IterType< Iter< TY, CON > >
 
struct  IterType< RangeIter< IT > >
 
class  LazyInit
 Mix-in for lazy/delayed initialisation of an embedded functor. More...
 
struct  Limited
 A Result Value confined into fixed bounds. More...
 
class  LinkedElements
 Intrusive single linked list, possibly taking ownership of node elements. More...
 
class  Literal
 inline string literal This is a marker type to indicate that More...
 
class  NobugResourceHandleContext
 Disabled placeholder for the Diagnostic context, not used in release builds. More...
 
struct  NoInstantiationCount
 Policy: no additional instantiation accounting. More...
 
struct  NullValue
 Singleton holder for NIL or default value objects. More...
 
class  NumIter
 Enumerate all "numbers" within a range. More...
 
class  OpaqueHolder
 Inline buffer to hold and own an object while concealing the concrete type. More...
 
class  OptionalRef
 Optional or switchable link to an existing object. More...
 
class  P
 Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relationships and ordering operators to the pointee objects. More...
 
class  PathArray
 Abstraction for path-like topological coordinates. More...
 
class  PlantingHandle
 A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBuffer, without having to disclose the concrete buffer type or size. More...
 
class  PolymorphicValue
 Template to build polymorphic value objects. More...
 
class  PtrDerefIter
 wrapper for an existing Iterator type, automatically dereferencing the output of the former. More...
 
class  QueryText
 Syntactical query representation. More...
 
class  RandomDraw
 A component and builder to draw limited parameter values based on some source of randomness (or hash input). More...
 
class  RandomSequencer
 Access point to a selection of random number sources. More...
 
class  RangeIter
 Accessing a STL element range through a Lumiera forward iterator, An instance of this iterator adapter is completely self-contained and allows to iterate once over the range of elements, until pos==end. More...
 
class  RefArray
 Abstraction: Array of const references. More...
 
class  RefArrayTable
 RefArray implementation based on a fixed size array, i.e. More...
 
class  RefArrayVector
 This variation of the wrapper actually is a vector, but can act as a RefArray. More...
 
class  RefArrayVectorWrapper
 Wrap a vector holding objects of a subtype and provide array-like access using the interface type. More...
 
class  Result
 Representation of the result of some operation, EITHER a value or a failure. More...
 
class  Result< void >
 The base case is just to capture success or failure, without returning any value result. More...
 
class  ScopedCollection
 A fixed collection of non-copyable polymorphic objects. More...
 
class  ScopedHolder
 Inline buffer holding and owning an object similar to unique_ptr. More...
 
class  ScopedPtrHolder
 Extension to std::unique_ptr, allowing copy operations on empty pointers (i.e. More...
 
class  ScopedPtrVect
 Simple vector based collection of pointers, managing lifecycle of the pointed-to objects. More...
 
class  SearchPathSplitter
 Helper: Access a path Specification as a sequence of filesystem Paths. More...
 
class  SeedNucleus
 Establishes a seed point for any instance or performance. More...
 
class  Several
 Abstraction: Fixed array of elements. More...
 
class  SeveralBuilder
 Builder to create and populate a lib::Several<I>. More...
 
class  SimpleAllocator
 Frontend for explicit allocations, using a custom allocator. More...
 
class  SingleValCore
 Implementation of a singleton value holder, which discards the contained value once "iterated". More...
 
class  SingleValIter
 Pseudo-Iterator to yield just a single value. More...
 
class  SkipRepetition
 Helper: predicate returning true whenever the argument value changes during a sequence of invocations. More...
 
struct  StorageFrame
 individual storage frame in a chain, holding a data tuple More...
 
struct  StorageLoc
 linked list of StorageFrame elements More...
 
class  SubID
 
class  SubId
 
class  Symbol
 Token or Atom with distinct identity. More...
 
class  SymbolTable
 Table for automatically interned strings. More...
 
class  Sync
 Facility for monitor object based locking. More...
 
class  SyncBarrier
 A one time N-fold mutual synchronisation barrier. More...
 
class  Thread
 A thin convenience wrapper to simplify thread-handling. More...
 
class  ThreadHookable
 Extended variant of the standard case, allowing to install callbacks (hook functions) to be invoked during thread lifecycle: More...
 
class  ThreadJoinable
 Variant of the standard case, requiring to wait and join() on the termination of this thread. More...
 
class  TransformingCore
 Implementation of custom processing logic. More...
 
class  TransformIter
 Iterator tool treating pulled data by a custom transformation (function) More...
 
class  TrojanFun
 »Trojan Function« builder. More...
 
class  TypedAllocationManager
 Foundation for a custom allocation manager, tracking the created objects by smart-ptrs. More...
 
class  TypedContext
 Provide type-IDs for a specific context. More...
 
class  TypedCounter
 Utility providing a set of counters, each tied to a specific type. More...
 
class  UninitialisedDynBlock
 Managed uninitialised Heap-allocated storage with array like access. More...
 
class  UninitialisedStorage
 Block of raw uninitialised storage with array like access. More...
 
class  UniqueMallocOwner
 Ownership token for a piece of heap memory allocated in plain-C style. More...
 
struct  UseInstantiationCounting
 Policy: maintain explicit per type instance count. More...
 
class  Variant
 Typesafe union record. More...
 
class  VariantO
 A variant wrapper (typesafe union) capable of holding a value of any of a bounded collection of types. More...
 
struct  VerbHolder
 
struct  VerbHolder< REC, RET(ARGS...)>
 Building block: actual storage for a "verb" (function pointer), together with the pre-bound invocation arguments for this specific operation. More...
 
struct  VerbInvoker
 Building block: the Interface to cause the invocation. More...
 
class  VerbPack
 A self-contained token to embody a specific yet abstracted operation, together with a concrete set of suitable arguments. More...
 
class  VerbToken
 Action token implemented by double dispatch to a handler function, as defined in the "receiver" interface (parameter REC). More...
 
class  VerbToken< REC, RET(ARGS...)>
 
class  WrappedLumieraIter
 Standard implementation of the IterSource interface: a wrapped "Lumiera Forward Iterator". More...
 
class  ZombieCheck
 Automatic lifecycle tracker, to produce an alarm when accessing objects after deletion. More...
 

Functions

template<class IT , class CON >
void append_all (IT iter, CON &container)
 
template<class N >
auto & asLinkedElements (N *const &anchor)
 transiently reinterpret an element pointer as const LinkedElements, allowing to count, iterate or subscript a chain of elements
 
template<class FUN , typename PAR >
auto binarySearch (FUN &&fun, PAR lower, PAR upper, PAR epsilon)
 
template<class FUN , typename PAR >
auto binarySearch_inner (FUN &&fun, PAR lower, PAR upper, PAR epsilon)
 binary search: actual search loop More...
 
template<class FUN , typename PAR >
auto binarySearch_upper (FUN &&fun, PAR lower, PAR upper, PAR epsilon)
 entrance point to binary search to ensure the upper point indeed fulfils the test. More...
 
template<class GEN >
auto buildCappedSubSequence (RandomSequencer< GEN > &src)
 
template<typename INT >
NumIter< INT > eachNum (INT start=std::numeric_limits< INT >::min(), INT end=std::numeric_limits< INT >::max())
 convenience function to iterate "each number"
 
template<typename T >
IterQueue< T > elements (T const &elm)
 convenience free function to build an iterable sequence
 
template<typename T >
IterQueue< T > elements (T const &e0, T const &e1)
 
template<typename T >
IterQueue< T > elements (T const &e0, T const &e1, T const &e2)
 
template<typename T >
IterQueue< T > elements (T const &e0, T const &e1, T const &e2, T const &e3)
 
template<typename T >
IterQueue< T > elements (T const &e0, T const &e1, T const &e2, T const &e3, T const &e4)
 
template<class IT >
auto explore (IT &&srcSeq)
 start building a IterExplorer by suitably wrapping the given iterable source. More...
 
template<class FUN , typename... ARGS>
auto failsafeInvoke (std::exception_ptr &capturedFailure, FUN &&callable, ARGS &&...args) noexcept
 Helper to invoke an arbitrary callable in a failsafe way. More...
 
template<class IT , typename PRED >
auto filterIterator (IT const &src, PRED filterPredicate)
 Build a FilterIter: convenience free function shortcut, picking up the involved types automatically. More...
 
template<class IT , typename PRED >
auto filterIterator (IT &&src, PRED filterPredicate)
 
template<class IT >
auto filterRepetitions (IT const &source)
 filters away repeated values emitted by source iterator
 
template<class IT >
auto filterRepetitions (IT &&source)
 
string findExePath ()
 retrieve the location of the executable More...
 
HashVal hash_value (QueryText const &entry)
 support using queries in hashtables. More...
 
size_t hash_value (SubID const &sID)
 
HashVal hash_value (Literal literal)
 generate hash value based on the Literal's contents. More...
 
HashVal hash_value (Symbol sym)
 hash value for Symbols is directly based on the symbol table entry
 
template<class... ITS>
auto izip (ITS &&...iters)
 tuple-combining iterator prefixed by index sequence
 
template<class TAR = ThreadHookable>
void launchDetached (ThreadHookable::Launch &&launchBuilder)
 Launch an autonomous self-managing thread (and forget about it). More...
 
template<class TAR = ThreadHookable, typename... INVO>
void launchDetached (string const &threadID, INVO &&...args)
 Launch an autonomous self-managing thread (and forget about it). More...
 
template<class TAR , typename... ARGS>
void launchDetached (string const &threadID, void(TAR::*memFun)(ARGS...), ARGS ...args)
 Special variant bind a member function of the subclass into the autonomous thread.
 
template<class TAR , typename... ARGS>
void launchDetached (void(TAR::*memFun)(ARGS...), ARGS ...args)
 Special variant without explicitly given thread-ID.
 
template<typename X , typename... ARGS>
P< X > makeP (ARGS &&... ctorArgs)
 Helper to create and manage by lib::P. More...
 
template<typename I , typename E = I>
SeveralBuilder< I, E > makeSeveral ()
 Entrance Point: start building a lib::Several instance. More...
 
template<typename X >
SeveralBuilder< X > makeSeveral (std::initializer_list< X > ili)
 
template<class VAL >
auto nilIterator ()
 not-anything-at-all iterator
 
template<typename TY1 , typename TY2 , class ALO >
bool operator!= (Allocator_TransferNoncopyable< TY1, ALO > const &, Allocator_TransferNoncopyable< TY2, ALO > const &)
 
bool operator!= (Literal const &s1, Literal const &s2)
 
bool operator!= (Symbol const &s1, Symbol const &s2)
 
bool operator!= (Literal s1, CStr s2)
 
template<class I1 , class I2 >
bool operator!= (PtrDerefIter< I1 > const &il, PtrDerefIter< I2 > const &ir)
 
bool operator!= (CStr s1, Literal s2)
 
bool operator!= (Symbol s1, CStr s2)
 
bool operator!= (CStr s1, Symbol s2)
 
bool operator!= (Literal s1, Symbol s2)
 
bool operator!= (Symbol s1, Literal s2)
 
bool operator!= (Literal s1, std::string s2)
 
bool operator!= (std::string s1, Literal s2)
 
bool operator!= (Symbol s1, std::string s2)
 
bool operator!= (std::string s1, Symbol s2)
 
template<class CX >
bool operator!= (IterTool< CX > const &ito1, IterTool< CX > const &ito2)
 
template<class I1 , class I2 >
bool operator!= (AddressExposingIter< I1 > const &il, AddressExposingIter< I2 > const &ir)
 
template<class P1 , class P2 , class CON >
bool operator!= (IterAdapter< P1, CON > const &il, IterAdapter< P2, CON > const &ir)
 
template<class ST , class T1 , class T2 >
bool operator!= (IterStateWrapper< ST, T1 > const &il, IterStateWrapper< ST, T2 > const &ir)
 
template<size_t cl, size_t cr>
bool operator!= (PathArray< cl > const &l, PathArray< cr > const &r)
 
template<class I1 , class I2 >
bool operator!= (RangeIter< I1 > const &il, RangeIter< I2 > const &ir)
 
template<class I1 , class I2 >
bool operator!= (ConstIter< I1 > const &il, ConstIter< I2 > const &ir)
 
std::string operator+ (std::string str, Literal const &sym)
 string concatenation
 
std::string operator+ (Literal const &sym, std::string str)
 
bool operator== (SubID const &id1, SubID const &id2)
 
template<typename TY1 , typename TY2 , class ALO >
bool operator== (Allocator_TransferNoncopyable< TY1, ALO > const &, Allocator_TransferNoncopyable< TY2, ALO > const &)
 
bool operator== (Literal const &s1, Literal const &s2)
 
bool operator== (Symbol const &s1, Symbol const &s2)
 
bool operator== (CStr s1, Literal s2)
 
bool operator== (Symbol s1, CStr s2)
 
bool operator== (CStr s1, Symbol s2)
 
bool operator== (Literal s1, Symbol s2)
 
bool operator== (Symbol s1, Literal s2)
 
bool operator== (Literal s1, std::string s2)
 
bool operator== (std::string s1, Literal s2)
 
bool operator== (Symbol s1, std::string s2)
 
bool operator== (std::string s1, Symbol s2)
 
template<class I1 , class I2 >
bool operator== (PtrDerefIter< I1 > const &il, PtrDerefIter< I2 > const &ir)
 Supporting equality comparisons...
 
template<class CX >
bool operator== (IterTool< CX > const &it1, IterTool< CX > const &it2)
 
template<class I1 , class I2 >
bool operator== (AddressExposingIter< I1 > const &il, AddressExposingIter< I2 > const &ir)
 Supporting equality comparisons...
 
template<class P1 , class P2 , class CON >
bool operator== (IterAdapter< P1, CON > const &il, IterAdapter< P2, CON > const &ir)
 Supporting equality comparisons...
 
template<class ST , class T1 , class T2 >
bool operator== (IterStateWrapper< ST, T1 > const &il, IterStateWrapper< ST, T2 > const &ir)
 Supporting equality comparisons of equivalent iterators (same state type)...
 
template<size_t cl, size_t cr>
bool operator== (PathArray< cl > const &l, PathArray< cr > const &r)
 Equality comparison of arbitrary PathArray objects.
 
template<class I1 , class I2 >
bool operator== (RangeIter< I1 > const &il, RangeIter< I2 > const &ir)
 Supporting equality comparisons...
 
template<class I1 , class I2 >
bool operator== (ConstIter< I1 > const &il, ConstIter< I2 > const &ir)
 Supporting equality comparisons...
 
template<typename T >
OptionalRef< T > optionalRefTo (T &target)
 
template<class IT >
auto ptrDeref (IT iter)
 Convenience shortcut to dereference pointers yielded from the wrapped iterator.
 
template<class IT >
IT::value_type pull_last (IT iter)
 
void randomiseRandomness ()
 inject true randomness into the defaultGen
 
lib::HashVal ranHash ()
 
int rani (uint bound=_iBOUND())
 
double ranNormal (double mean=0.0, double stdev=1.0)
 
double ranRange (double start, double bound)
 
string replaceMagicLinkerTokens (string const &src)
 replace $ORIGIN tokens in the given string More...
 
string resolveModulePath (fsys::path moduleName, string searchPath="")
 helper to establish the location to search for loadable modules, configuration files, icons and further resources. More...
 
template<typename VAL , typename = lib::meta::disable_if<std::is_invocable<VAL>>>
 Result (VAL &&) -> Result< VAL >
 deduction guide: allow perfect forwarding of a any result into the ctor call. More...
 
template<typename FUN , typename... ARGS>
 Result (FUN &&, ARGS &&...) -> Result< std::invoke_result_t< FUN, ARGS... >>
 deduction guide: find out about result value to capture from a generic callable. More...
 
SeedNucleusseedFromDefaultGen ()
 draw seed another Generator from the default RandomSequencer
 
template<class VAL >
auto singleValIterator (VAL &&something)
 Build a SingleValIter: convenience free function shortcut, to pick up just any value and wrap it as Lumiera Forward Iterator. More...
 
template<typename FUN , typename... ARGS>
 ThreadJoinable (string const &, FUN &&, ARGS &&...) -> ThreadJoinable< std::invoke_result_t< FUN, ARGS... >>
 deduction guide: find out about result value to capture from a generic callable. More...
 
template<class IT , typename FUN >
auto transformIterator (IT const &src, FUN processingFunc)
 Build a TransformIter: convenience free function shortcut, picking up the involved types automatically. More...
 
template<class IT , typename FUN >
auto transformIterator (IT &&src, FUN processingFunc)
 
template<class... ITS>
auto zip (ITS &&...iters)
 Build a tuple-combining iterator builder. More...
 

Variables

Random defaultGen {eternalNucleus}
 a global default RandomSequencer for mundane purposes
 
Random entropyGen {entropyNucleus}
 a global RandomSequencer seeded with real entropy
 
const size_t STRING_MAX_RELEVANT = LUMIERA_IDSTRING_MAX_RELEVANT
 safety guard: maximum number of chars to process. More...
 

Class Documentation

◆ lib::IterType

struct lib::IterType
+ Inheritance diagram for IterType< TY >:
+ Collaboration diagram for IterType< TY >:

◆ lib::IterType< Iter< TY, CON > >

struct lib::IterType< Iter< TY, CON > >
Class Members
typedef CON Container
typedef TY ElemType
+ Collaboration diagram for IterType< Iter< TY, CON > >:

◆ lib::VerbHolder

struct lib::VerbHolder
+ Collaboration diagram for VerbHolder< REC, SIG >:

◆ lib::VerbToken

class lib::VerbToken
+ Collaboration diagram for VerbToken< REC, SIG >:

Function Documentation

◆ binarySearch_inner()

auto lib::binarySearch_inner ( FUN &&  fun,
PAR  lower,
PAR  upper,
PAR  epsilon 
)
inline

binary search: actual search loop

  • search until (upper-lower) < epsilon
  • the FUN performs the actual test
  • the goal is to narrow down the breaking point
    Parameters
    funbool(PAR) perform probe and decide criterion.
    Note
    fun(lower) must be false and fun(upper) must be true

Definition at line 56 of file binary-search.hpp.

◆ binarySearch_upper()

auto lib::binarySearch_upper ( FUN &&  fun,
PAR  lower,
PAR  upper,
PAR  epsilon 
)
inline

entrance point to binary search to ensure the upper point indeed fulfils the test.

If this is not the case, the search domain is shifted up, but also expanded so that the given upper point is still located within, but close to the lower end.

Note
fun(lower) must be false

Definition at line 81 of file binary-search.hpp.

Referenced by BreakingPoint< CONF >::conductBinarySearch().

+ Here is the caller graph for this function:

◆ explore()

auto lib::explore ( IT &&  srcSeq)
inline

start building a IterExplorer by suitably wrapping the given iterable source.

Returns
a TreeEplorer, which is an Iterator to yield all the source elements, but may also be used to build up a complex processing pipeline.
Warning
if you capture the result of this call by an auto variable, be sure to understand that invoking any further builder operation on IterExplorer will invalidate that variable (by moving it into the augmented iterator returned from such builder call).
Todo:
this framework should be retrofitted to fit in with C++20 pipelines

Usage

This function starts a Builder expression. It picks up the given source, which can be something "sequence-like" or "iterable", and will automatically be wrapped and adapted.

  • from a STL container, we retrieve a pair of STL iterators (begin(), end())
  • a "Lumiera Forward Iterator" is copied or moved into the wrapper and used as data source, when pulling results on demand, until exhaustion
  • a State Core object is copied or moved into the wrapper and adapted to be iterated as "Lumiera Forward Iterator". Any object with suitable extension points and behaviour can be used, as explained here.

The resulting IterExplorer instance can directly be used as "Lumiera Forward Iterator". However, typically you might want to invoke the builder functions to configure further processing steps in a processing pipeline...

  • to filter the results with a predicate (functor)
  • to transform the yielded results
  • to bind and configure a child expansion operation, which can then be triggered by explicitly invoking .expandChildren() on the resulting pipeline; the generated child sequence is "flat mapped" into the results (a Monad style usage).
  • to package the pipeline built thus far behind an opaque interface and move the implementation into heap memory.

A typical usage might be...

auto multiply = [](int v){ return 2*v; };
auto ii = explore (CountDown{7,4})
.transform(multiply);
CHECK (14 == *ii);
++ii;
CHECK (12 == *ii);
++ii;

In this example, a CountDown state core is used, as defined in iter-explorer-test.cpp

Definition at line 2189 of file iter-explorer.hpp.

Referenced by SeveralBuilder< POL, std::reference_wrapper >::appendAll(), TreeStructureNavigator::buildIterator(), lib::iter::buildIterTuple(), Num< i >::calc(), IterZip_test::demo_construction(), IterZip_test::demo_mapToTuple(), IterExplorer_test::demonstrate_LayeredEvaluation(), IncidenceCount::evaluate(), TextTemplate::keys(), TextTemplate::submit(), lib::test::anonymous_namespace{sync-barrier-test.cpp}::sumLocals(), Dispatcher::PipelineBuilder< SRC >::timeRange(), IterExplorer_test::verify_aggregatingGroupItration(), IterExplorer_test::verify_combinedExpandTransform(), IterExplorer_test::verify_customProcessingLayer(), IterExplorer_test::verify_dedup(), IterExplorer_test::verify_depthFirstExploration(), IterExplorer_test::verify_effuse(), IterExplorer_test::verify_elementGroupingOperation(), IterExplorer_test::verify_expand_rootCurrent(), IterExplorer_test::verify_expandOperation(), IterExplorer_test::verify_FilterChanges(), IterExplorer_test::verify_FilterIterator(), IterExplorer_test::verify_IterSource(), IterExplorer_test::verify_reduceVal(), IterZip_test::verify_references(), IterExplorer_test::verify_scheduledExpansion(), IterExplorer_test::verify_transformOperation(), IterExplorer_test::verify_untilStopTrigger(), IterExplorer_test::verify_wrappedState(), ExtentFamily_test::wrapAround(), and zip().

+ Here is the caller graph for this function:

◆ zip()

auto lib::zip ( ITS &&...  iters)
inline

Build a tuple-combining iterator builder.

Parameters
itersan arbitrary sequence of iterable entities
Returns
an IterExplorer to yield result tuples on iteration
Remarks
IterExplorer is both a »Lumiera Forward Iterator« and a Pipeline Builder
  • as Lumiera iterator, it can be used directly in for-each and while loops
  • result components can be picked up conveniently through structural bindings for tuples
  • using the builder API, results can be postprocessed (apply a function), filtered, searched, reduced...

Definition at line 138 of file iter-zip.hpp.

References explore().

Referenced by steam::engine::test::combineFrames(), izip(), steam::engine::test::manipulateFrame(), NodeDevel_test::processing_combineFrames(), NodeDevel_test::processing_manipulateFrame(), and IterZip_test::simpleUsage().

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

◆ filterIterator()

auto lib::filterIterator ( IT const &  src,
PRED  filterPredicate 
)
inline

Build a FilterIter: convenience free function shortcut, picking up the involved types automatically.

Parameters
filterPredicateto be invoked for each source element
Returns
Iterator filtering contents of the source

Definition at line 372 of file itertools.hpp.

Referenced by filterRepetitions().

+ Here is the caller graph for this function:

◆ singleValIterator()

auto lib::singleValIterator ( VAL &&  something)
inline

Build a SingleValIter: convenience free function shortcut, to pick up just any value and wrap it as Lumiera Forward Iterator.

Returns
Iterator to yield the value once
Warning
be sure to understand that we literally pick up and wrap anything provided as argument. If you pass a reference, we wrap a reference. If you want to wrap a copy, you have to do the copy yourself inline

Definition at line 655 of file itertools.hpp.

Referenced by IterTools_test::buildWrappedSingleElement(), and lib::iter_source::singleVal().

+ Here is the caller graph for this function:

◆ transformIterator()

auto lib::transformIterator ( IT const &  src,
FUN  processingFunc 
)
inline

Build a TransformIter: convenience free function shortcut, picking up the involved types automatically.

Template Parameters
processingFuncto be invoked for each source element
Returns
Iterator processing the source feed

Definition at line 788 of file itertools.hpp.

Referenced by JobPlanning::buildDependencyPlanning(), FormatHelper_test::checkStringJoin(), JobTicket::getPrerequisites(), Record< VAL >::operator std::string(), TestMutationTarget::showContent(), TestMutationTarget::showSrcBuffer(), util::stringify(), and lib::iter_source::transform().

+ Here is the caller graph for this function:

◆ makeP()

P<X> lib::makeP ( ARGS &&...  ctorArgs)
inline

Helper to create and manage by lib::P.

Template Parameters
Xthe type of the new object to create on the heap
Parameters
ctorArgsarbitrary arguments to pass to ctor of X
Returns
managing smart-ptr of type P<X>, holding onto the object just created on the heap.

Definition at line 135 of file p.hpp.

◆ hash_value() [1/2]

HashVal lib::hash_value ( QueryText const &  entry)

support using queries in hashtables.

Warning
right now (2012) the dummy implementation of QueryText doesn't normalise the query in any way, which makes the generated hash value dependent on the actual textual form used to build the QueryText. This is not how it's intended to work, it should rely on a normalised form after parsing the query definition.

Definition at line 52 of file query-text.cpp.

Referenced by Literal::Literal().

+ Here is the caller graph for this function:

◆ rani()

int lib::rani ( uint  bound = _iBOUND())
inline
Returns
a random integer ∈ [0 ... bound[
Examples:
/Werk/devel/lumi/src/lib/test/test-helper.hpp.

Definition at line 135 of file random.hpp.

Referenced by RandomConcurrent_test::benchmark_random_gen(), CommandCloneBuilder_test::bindRandArgument(), MockJob::build(), ScopedCollection_test::building_RAII_Style(), ScopedCollection_test::building_StackStyle(), DelStash_test::checkCustomKill(), HandlingPatternBasics_test::checkExec(), AdviceBasics_test::createCollaboration(), JobPlanningPipeline_test::demonstrateScaffolding(), LateBindInstance_test::demonstrateUsage(), lib::query::test::garbage_query(), lumiera::query::test::anonymous_namespace{defs-registry-impl-test.cpp}::newID(), steam::mobject::session::test::anonymous_namespace{defs-manager-impl-test.cpp}::newID(), AdviceBasics_test::overwriting_and_retracting(), NodeDevel_test::processing_duplicateMultichan(), NodeDevel_test::processing_generateMultichan(), NodeDevel_test::processing_manipulateMultichan(), CanvasHook_test::relocateWidget(), ExtentFamily_test::reuseUnclean(), AdviceBasics_test::simpleExchange(), Random_test::simpleUsage(), ExtentFamily_test::simpleUsage(), Random_test::verify_distributionVariants(), HashGenerator_test::verify_Knuth_workaround(), LazyInit_test::verify_lazyInitialisation(), MockSupport_test::verify_MockJob(), LazyInit_test::verify_TargetRelocation(), LazyInit_test::verify_triggerMechanism(), NodeBase_test::verify_TurnoutSystem(), SchedulerActivity_test::verifyActivity_Invoke(), AllocationCluster_test::verifyInternals(), ReplaceableItem_test::verifyNonComparableElements(), ReplaceableItem_test::verifyOnlyMoveConstructible(), and ItemWrapper_test::verifyWrappedRef().

+ Here is the caller graph for this function:

◆ ranRange()

double lib::ranRange ( double  start,
double  bound 
)
inline
Returns
a random double ∈ [start ... bound[

Definition at line 142 of file random.hpp.

References RandomSequencer< GEN >::normal(), and RandomSequencer< GEN >::range().

+ Here is the call graph for this function:

◆ ranHash()

lib::HashVal lib::ranHash ( )
inline
Returns
a random non-zero HashVal

Definition at line 155 of file random.hpp.

References RandomSequencer< GEN >::hash(), randomiseRandomness(), and seedFromDefaultGen().

+ Here is the call graph for this function:

◆ failsafeInvoke()

auto lib::failsafeInvoke ( std::exception_ptr &  capturedFailure,
FUN &&  callable,
ARGS &&...  args 
)
inlinenoexcept

Helper to invoke an arbitrary callable in a failsafe way.

Parameters
capturedFailurereference to a std::exeption_ptr served by side-effect
callableanything std::invoke can handle
Returns
if the invokable has a return type, the result is returned, otherwise this is a void function
Todo:
with C++20 the body of the implementation can be replaced by std::invoke_r //////////////////////TICKET #1245

Definition at line 65 of file result.hpp.

Referenced by Result< void >::Result(), and Result< TAR &>::Result().

+ Here is the caller graph for this function:

◆ Result() [1/2]

lib::Result ( VAL &&  ) -> Result< VAL >

deduction guide: allow perfect forwarding of a any result into the ctor call.

Referenced by TextTemplate::Action::instantiate(), and ElementQuery::pick().

+ Here is the caller graph for this function:

◆ Result() [2/2]

lib::Result ( FUN &&  ,
ARGS &&  ... 
) -> Result< std::invoke_result_t< FUN, ARGS... >>

deduction guide: find out about result value to capture from a generic callable.

◆ findExePath()

string findExePath ( )

retrieve the location of the executable

helper to figure out the installation directory, as given by the absolute path of the currently executing program

Warning
this is Linux specific code

Definition at line 44 of file searchpath.cpp.

References GET_PATH_TO_EXECUTABLE, and STRING_MAX_RELEVANT.

Referenced by replaceMagicLinkerTokens().

+ Here is the caller graph for this function:

◆ replaceMagicLinkerTokens()

string replaceMagicLinkerTokens ( string const &  src)

replace $ORIGIN tokens in the given string

helper to replace all $ORIGIN prefixes in a given string by the directory holding the current executable

Note
also picks ORIGIN, $ORIGIN/, ORIGIN/
Returns
copy with expansions applied

Definition at line 65 of file searchpath.cpp.

References findExePath().

+ Here is the call graph for this function:

◆ resolveModulePath()

string resolveModulePath ( fsys::path  moduleName,
string  searchPath = "" 
)

helper to establish the location to search for loadable modules, configuration files, icons and further resources.

After first trying the moduleName directly, the given search path is walked using the SearchPathSplitter, until encountering an existing file with the given name.

Returns
the absolute pathname of the module file found
Exceptions
error::Configwhen the resolution fails

Definition at line 79 of file searchpath.cpp.

Referenced by lumiera::anonymous_namespace{basic-setup.cpp}::resolve(), and UiStyle::setTheme().

+ Here is the caller graph for this function:

◆ makeSeveral()

SeveralBuilder<I,E> lib::makeSeveral ( )

Entrance Point: start building a lib::Several instance.

Template Parameters
IInterface type to use for element access
E(optional) standard element implementation type
Returns
a builder instance with methods to create or copy data elements to populate the container...

Definition at line 869 of file several-builder.hpp.

References SeveralBuilder< I, E, POL >::reserve().

Referenced by SeveralBuilder_test::check_ElementStorage().

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

◆ hash_value() [2/2]

HashVal hash_value ( Literal  literal)

generate hash value based on the Literal's contents.

This function is intended to be picked up by ADL, and should be usable both with std::hash and <boost/functional/hash.hpp>. It is implemented similar as the boost::hash specialisation for std::string

Definition at line 104 of file symbol-impl.cpp.

◆ operator==()

bool lib::operator== ( Symbol const &  s1,
Symbol const &  s2 
)
inline
Note
comparison of symbol table entries

Definition at line 180 of file symbol.hpp.

References Literal::operator==().

+ Here is the call graph for this function:

◆ ThreadJoinable()

lib::ThreadJoinable ( string const &  ,
FUN &&  ,
ARGS &&  ... 
) -> ThreadJoinable< std::invoke_result_t< FUN, ARGS... >>

deduction guide: find out about result value to capture from a generic callable.

◆ launchDetached() [1/2]

void lib::launchDetached ( ThreadHookable::Launch &&  launchBuilder)
inline

Launch an autonomous self-managing thread (and forget about it).

The thread-object is allocated to the heap and will delete itself on termination.

Template Parameters
TARconcrete type of the subclass to be started as autonomous detached thread.
Parameters
launchBuildera flexible thread launch configuration to be used for starting; especially this contains the thread function and arguments to run in the thread.
Note
hooks atExit and onOrphan defined in the launchBuilder will be overridden.
Remarks
the atExit hook is the last piece of code executed within the thread; here it takes a pointer to the allocated instance of type TAR and deletes it from heap. Obviously this will invoke the destructor of the thread-wrapper eventually, at which point the onOrphan hook is invoked (since the thread is still running); at this point the C++ thread-handle is detached, so that invoking the dtor of std::thread will not terminate the system, rather just let the thread go away. The net result is an object of type TAR placed on the heap and kept there precisely as long as the thread runs.

Definition at line 742 of file thread.hpp.

Referenced by ThreadWrapperAutonomous_test::demonstrateSimpleUsage(), and OutputDirector::triggerDisconnect().

+ Here is the caller graph for this function:

◆ launchDetached() [2/2]

void lib::launchDetached ( string const &  threadID,
INVO &&...  args 
)
inline

Launch an autonomous self-managing thread (and forget about it).

Template Parameters
TARconcrete type of the subclass to be started as autonomous detached thread.
Parameters
argsa valid argument list to call the ctor of thread::ThreadLifecycle

Definition at line 765 of file thread.hpp.

Variable Documentation

◆ STRING_MAX_RELEVANT

const size_t STRING_MAX_RELEVANT = LUMIERA_IDSTRING_MAX_RELEVANT

safety guard: maximum number of chars to process.

For comparisons, hash calculations etc., when dealing with raw char ptrs (typically literal values)

Definition at line 46 of file symbol-impl.cpp.

Referenced by findExePath().