Lumiera  0.pre.03
»edit your freedom«
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 115 of file split-splice.hpp.

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. More...
 
void determineRelations ()
 Stage-3 of the algorithm works out the precise relation of the predecessor and successor segments to determine necessary adjustments. More...
 
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. More...
 
std::array< POS, 3 > performSplitSplice ()
 Stage-4 of the algorithm performs the actual insert and deleting of segments. More...
 

Classes

struct  SegBounds
 

Private Types

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

Private Attributes

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

Additional Inherited Members

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

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:

Constructor & Destructor Documentation

◆ Algo()

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 166 of file split-splice.hpp.

References Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::establishSplitPoint().

+ Here is the call graph for this function:

Member Function Documentation

◆ establishSplitPoint()

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 200 of file split-splice.hpp.

Referenced by Algo< ORD, POS, START, AFTER, CREATE, EMPTY, CLONE, DELETE >::Algo().

+ Here is the caller graph for this function:

◆ determineRelations()

void determineRelations ( )
inline

Stage-3 of the algorithm works out the precise relation of the predecessor and successor segments to determine necessary adjustments.

Remarks
results in definition of operation verbs #opPred_ and #opSucc_.

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

◆ performSplitSplice()

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 300 of file split-splice.hpp.

+ 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: