Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE > Class Template Reference

#include "lib/split-splice.hpp"

Description

template<class ORD, class POS, class START, class AFTER, class CREATE, class EMPTY, class CLONE, class DELETE>
class lib::splitsplice::Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >

Implementation of »SplitSplice« algorithm.

Descriptor and working context to split/splice in a new Interval. The »Split-Splice« algorithm works on a seamless segmentation of an ordered working axis, represented as sequence of intervals. The purpose is to integrate a new Segment / interval, thereby truncating / splitting / filling adjacent intervals to fit

Definition at line 107 of file split-splice.hpp.

Classes

struct  SegBounds
 

Public Member Functions

 Algo (START fun_getStart, AFTER fun_getAfter, CREATE fun_createSeg, EMPTY fun_emptySeg, CLONE fun_cloneSeg, DELETE fun_discard, const ORD axisEnd, POS startAll, POS afterAll, OptORD start, OptORD after)
 Setup for a single SplitSplice-operation to insert a new segment start to after.
 
SegBounds establishSplitPoint (POS startAll, POS afterAll, OptORD start, OptORD after)
 Stage-1 and Stage-2 of the algorithm determine the insert point and establish the actual start and end point of the new segment.
 
void determineRelations ()
 Stage-3 of the algorithm works out the precise relation of the predecessor and successor segments to determine necessary adjustments.
 
std::array< POS, 3 > performSplitSplice ()
 Stage-4 of the algorithm performs the actual insert and deleting of segments.
 

Private Types

enum  Verb {
  NIL ,
  DROP ,
  TRUNC ,
  INS_NOP ,
  SEAMLESS
}
 
using OptORD = std::optional< ORD >
 

Private Attributes

START getStart
 
AFTER getAfter
 
CREATE createSeg
 
EMPTY emptySeg
 
CLONE cloneSeg
 
DELETE discard
 
const ORD AXIS_END
 
POS pred_
 
POS succ_
 
struct lib::splitsplice::Algo::SegBounds b_
 
Verb opPred_ = NIL
 
Verb opSucc_ = NIL
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Constructor & Destructor Documentation

◆ Algo()

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
Algo ( START  fun_getStart,
AFTER  fun_getAfter,
CREATE  fun_createSeg,
EMPTY  fun_emptySeg,
CLONE  fun_cloneSeg,
DELETE  fun_discard,
const ORD  axisEnd,
POS  startAll,
POS  afterAll,
OptORD  start,
OptORD  after 
)
inline

Setup for a single SplitSplice-operation to insert a new segment start to after.

Parameters
startAll(forward) iterator pointing at the overall Segmentation begin
afterAll(forward) iterator indicating point-after-end of Segmentation
start(optional) specification of new segment's start point
after(optional) specification of new segment's end point

Definition at line 158 of file split-splice.hpp.

References Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::SegBounds::after, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::b_, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::getStart, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::pred_, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::SegBounds::start, and Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::succ_.


Class Documentation

◆ lib::splitsplice::Algo::SegBounds

struct lib::splitsplice::Algo::SegBounds
Class Members
ORD start
ORD after
+ Collaboration diagram for Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::SegBounds:

Member Typedef Documentation

◆ OptORD

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
using OptORD = std::optional<ORD>
private

Definition at line 126 of file split-splice.hpp.

Member Enumeration Documentation

◆ Verb

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
enum Verb
private
Enumerator
NIL 
DROP 
TRUNC 
INS_NOP 
SEAMLESS 

Definition at line 140 of file split-splice.hpp.

Member Function Documentation

◆ establishSplitPoint()

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
SegBounds establishSplitPoint ( POS  startAll,
POS  afterAll,
OptORD  start,
OptORD  after 
)
inline

Stage-1 and Stage-2 of the algorithm determine the insert point and establish the actual start and end point of the new segment.

Returns
the definitive start and after ORD values, based on context

Definition at line 192 of file split-splice.hpp.

References Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::AXIS_END, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::getAfter, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::getStart, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::pred_, and Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::succ_.

◆ determineRelations()

◆ performSplitSplice()

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
std::array< POS, 3 > performSplitSplice ( )
inline

Stage-4 of the algorithm performs the actual insert and deleting of segments.

Returns
(s,n,e) to indicate where changes happened
  • s the first changed element
  • n the new main segment (may be identical to s)
  • e the first unaltered element after the changed range (may be end())

Definition at line 292 of file split-splice.hpp.

References Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::SegBounds::after, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::b_, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::cloneSeg, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::createSeg, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::discard, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::DROP, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::emptySeg, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::getAfter, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::getStart, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::INS_NOP, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::NIL, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::opPred_, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::opSucc_, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::pred_, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::SEAMLESS, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::SegBounds::start, Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::succ_, and Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::TRUNC.

Member Data Documentation

◆ getStart

◆ getAfter

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
AFTER getAfter
private

◆ createSeg

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
CREATE createSeg
private

◆ emptySeg

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
EMPTY emptySeg
private

◆ cloneSeg

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
CLONE cloneSeg
private

◆ discard

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
DELETE discard
private

◆ AXIS_END

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
const ORD AXIS_END
private

◆ pred_

◆ succ_

◆ b_

◆ opPred_

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
Verb opPred_ = NIL
private

◆ opSucc_

template<class ORD , class POS , class START , class AFTER , class CREATE , class EMPTY , class CLONE , class DELETE >
Verb opSucc_ = NIL
private
+ Inheritance diagram for Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >:
+ Collaboration diagram for Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >:

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