Lumiera  0.pre.03
»edityourfreedom«
TestMutationTarget Class Reference

#include "lib/diff/test-mutation-target.hpp"

Description

Test adapter to watch and verify how the TreeMutator binds to custom tree data structures.

As a data structure, the TestMutationTarget builds an »External Tree Description« reflecting the actual data structure, as can be inferred through listening to all handled diff mutation primitives. Besides, each of these primitives is recorded in the embedded EventLog.

See also
TreeMutatorBinding_test::mutateDummy()

Definition at line 195 of file test-mutation-target.hpp.

Public Types

using const_iterator = typename iter_stl::_SeqT< const VecG >::Range
 
using iterator = typename iter_stl::_SeqT< VecG >::Range
 

Public Member Functions

const_iterator begin () const
 
bool empty () const
 
const_iterator end () const
 
EventMatch ensureNot (string match) const
 
EventLog const & getLog () const
 
iterator initMutation (string mutatorID)
 
void inject (GenNode &&elm, string operationID)
 
iterator lastElm ()
 
iterator locate (GenNode::ID const &targetID)
 
void logAssignment (GenNode const &target, string oldPayload)
 
void logMutation (GenNode const &target)
 
void logScopeCompletion (iterator processingPos)
 
void logSkip (GenNode const &content)
 
string showContent () const
 render payload content for diagnostics More...
 
string showSrcBuffer () const
 render elements waiting in source buffer to be accepted More...
 
iterator srcIter ()
 
EventMatch verify (string match) const
 
EventMatch verifyCall (string match) const
 
EventMatch verifyEvent (string match) const
 
EventMatch verifyEvent (string classifier, string match) const
 
EventMatch verifyMatch (string regExp) const
 

Static Public Member Functions

static iterator search (GenNode::ID const &targetID, iterator pos)
 

Friends

const_iterator begin (TestMutationTarget const &target)
 
const_iterator end (TestMutationTarget const &target)
 

Private Types

using VecG = std::vector< GenNode >
 

Private Attributes

VecG content_
 
EventLog log_
 
VecG prev_content_
 

Additional Inherited Members

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

Member Typedef Documentation

◆ VecG

using VecG = std::vector<GenNode>
private

Definition at line 198 of file test-mutation-target.hpp.

◆ iterator

using iterator = typename iter_stl::_SeqT<VecG>::Range

Definition at line 207 of file test-mutation-target.hpp.

◆ const_iterator

using const_iterator = typename iter_stl::_SeqT<const VecG>::Range

Definition at line 208 of file test-mutation-target.hpp.

Member Function Documentation

◆ begin()

const_iterator begin ( ) const
inline

Definition at line 210 of file test-mutation-target.hpp.

References lib::iter_stl::eachElm().

+ Here is the call graph for this function:

◆ end()

const_iterator end ( ) const
inline

Definition at line 211 of file test-mutation-target.hpp.

◆ srcIter()

iterator srcIter ( )
inline

Definition at line 213 of file test-mutation-target.hpp.

References lib::iter_stl::eachElm().

+ Here is the call graph for this function:

◆ lastElm()

iterator lastElm ( )
inline

Definition at line 214 of file test-mutation-target.hpp.

◆ initMutation()

iterator initMutation ( string  mutatorID)
inline

Definition at line 225 of file test-mutation-target.hpp.

◆ inject()

void inject ( GenNode &&  elm,
string  operationID 
)
inline

Definition at line 234 of file test-mutation-target.hpp.

◆ search()

static iterator search ( GenNode::ID const &  targetID,
iterator  pos 
)
inlinestatic

Definition at line 241 of file test-mutation-target.hpp.

Referenced by TestMutationTarget::getLog().

+ Here is the caller graph for this function:

◆ locate()

iterator locate ( GenNode::ID const &  targetID)
inline

Definition at line 249 of file test-mutation-target.hpp.

References lib::iter_stl::eachElm().

+ Here is the call graph for this function:

◆ logSkip()

void logSkip ( GenNode const &  content)
inline

Definition at line 258 of file test-mutation-target.hpp.

References lib::meta::BOTTOM_INDICATOR, BareEntryID::getSym(), GenNode::idi, and util::isnil().

+ Here is the call graph for this function:

◆ logAssignment()

void logAssignment ( GenNode const &  target,
string  oldPayload 
)
inline

Definition at line 264 of file test-mutation-target.hpp.

References GenNode::data, BareEntryID::getSym(), and GenNode::idi.

+ Here is the call graph for this function:

◆ logMutation()

void logMutation ( GenNode const &  target)
inline

Definition at line 273 of file test-mutation-target.hpp.

References GenNode::data, BareEntryID::getSym(), and GenNode::idi.

+ Here is the call graph for this function:

◆ logScopeCompletion()

void logScopeCompletion ( iterator  processingPos)
inline

Definition at line 281 of file test-mutation-target.hpp.

◆ empty()

bool empty ( ) const
inline

Definition at line 292 of file test-mutation-target.hpp.

◆ showContent()

string showContent ( ) const
inline

render payload content for diagnostics

Definition at line 299 of file test-mutation-target.hpp.

References util::join(), and lib::transformIterator().

Referenced by TreeMutatorBinding_test::mutateAttribute(), and TreeMutatorBinding_test::mutateDummy().

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

◆ showSrcBuffer()

string showSrcBuffer ( ) const
inline

render elements waiting in source buffer to be accepted

Definition at line 306 of file test-mutation-target.hpp.

References lib::iter_stl::eachElm(), util::join(), and lib::transformIterator().

Referenced by TreeMutatorBinding_test::mutateDummy().

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

◆ verify()

EventMatch verify ( string  match) const
inline

Definition at line 312 of file test-mutation-target.hpp.

Referenced by TreeMutatorBinding_test::mutateDummy().

+ Here is the caller graph for this function:

◆ verifyMatch()

EventMatch verifyMatch ( string  regExp) const
inline

Definition at line 318 of file test-mutation-target.hpp.

◆ verifyEvent() [1/2]

EventMatch verifyEvent ( string  match) const
inline

Definition at line 324 of file test-mutation-target.hpp.

Referenced by TreeMutatorBinding_test::mutateDummy().

+ Here is the caller graph for this function:

◆ verifyEvent() [2/2]

EventMatch verifyEvent ( string  classifier,
string  match 
) const
inline

Definition at line 330 of file test-mutation-target.hpp.

◆ verifyCall()

EventMatch verifyCall ( string  match) const
inline

Definition at line 336 of file test-mutation-target.hpp.

◆ ensureNot()

EventMatch ensureNot ( string  match) const
inline

Definition at line 342 of file test-mutation-target.hpp.

◆ getLog()

EventLog const& getLog ( ) const
inline

Definition at line 348 of file test-mutation-target.hpp.

References Ref::ATTRIBS, TreeMutator::build(), PlantingHandle< BA >::create(), Ref::END, BareEntryID::getSym(), GenNode::idi, util::isnil(), GenNode::matches(), and TestMutationTarget::search().

Referenced by TreeMutatorBinding_test::mutateAttribute(), and TreeMutatorBinding_test::mutateDummy().

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

Member Data Documentation

◆ log_

EventLog log_
private

Definition at line 200 of file test-mutation-target.hpp.

◆ content_

VecG content_
private

Definition at line 202 of file test-mutation-target.hpp.

◆ prev_content_

VecG prev_content_
private

Definition at line 203 of file test-mutation-target.hpp.

Friends And Related Function Documentation

◆ begin

const_iterator begin ( TestMutationTarget const &  target)
friend

Definition at line 217 of file test-mutation-target.hpp.

◆ end

const_iterator end ( TestMutationTarget const &  target)
friend

Definition at line 218 of file test-mutation-target.hpp.

+ Inheritance diagram for TestMutationTarget:
+ Collaboration diagram for TestMutationTarget:

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