GTIRB  v2.2.0
GrammaTech Intermediate Representation for Binaries: C++ API
Public Member Functions | List of all members
gtirb::SectionObserver Class Referenceabstract

Interface for notifying observers when the Section is modified. More...

#include <Section.hpp>

Public Member Functions

virtual ~SectionObserver ()=default
 
virtual ChangeStatus addCodeBlocks (Section *S, Section::code_block_range Blocks)=0
 Notify the parent when new CodeBlocks are added to the Section. More...
 
virtual ChangeStatus addDataBlocks (Section *S, Section::data_block_range Blocks)=0
 Notify the parent when new DataBlocks are added to the Section. More...
 
virtual ChangeStatus changeExtent (Section *S, std::function< void(Section *)> Callback)=0
 Notify parent when the range of addresses in the Section changes. More...
 
virtual ChangeStatus moveCodeBlocks (Section *S, Section::code_block_range Blocks)=0
 Notify the parent when the addresses of existing CodeBlocks change. More...
 
virtual ChangeStatus moveDataBlocks (Section *S, Section::data_block_range Blocks)=0
 Notify the parent when the addresses of existing DataBlocks change. More...
 
virtual ChangeStatus nameChange (Section *S, const std::string &OldName, const std::string &NewName)=0
 Notify the parent when this Section's name changes. More...
 
virtual ChangeStatus removeCodeBlocks (Section *S, Section::code_block_range Blocks)=0
 Notify the parent when CodeBlocks are removed from the Section. More...
 
virtual ChangeStatus removeDataBlocks (Section *S, Section::data_block_range Blocks)=0
 Notify the parent when DataBlocks are removed from the Section. More...
 

Detailed Description

Interface for notifying observers when the Section is modified.

Constructor & Destructor Documentation

◆ ~SectionObserver()

virtual gtirb::SectionObserver::~SectionObserver ( )
virtualdefault

Member Function Documentation

◆ addCodeBlocks()

virtual ChangeStatus gtirb::SectionObserver::addCodeBlocks ( Section S,
Section::code_block_range  Blocks 
)
pure virtual

Notify the parent when new CodeBlocks are added to the Section.

Called after the Section updates its internal state.

Parameters
Sthe Section to which CodeBlocks were added.
Blocksa range containing the new CodeBlocks.
Returns
indication of whether the observer accepts the change.

◆ addDataBlocks()

virtual ChangeStatus gtirb::SectionObserver::addDataBlocks ( Section S,
Section::data_block_range  Blocks 
)
pure virtual

Notify the parent when new DataBlocks are added to the Section.

Called after the Section updates its internal state.

Parameters
Sthe Section to which DataBlocks were added.
Blocksa range containing the new DataBlocks.
Returns
indication of whether the observer accepts the change.

◆ changeExtent()

virtual ChangeStatus gtirb::SectionObserver::changeExtent ( Section S,
std::function< void(Section *)>  Callback 
)
pure virtual

Notify parent when the range of addresses in the Section changes.

Called before the Section's extent changes. This method should invoke the callback with S to update its extent.

Parameters
Sthe Section that changed.
Callbackcallable to update the ByteInterval's extent.
Returns
indication of whether the observer accepts the change.

◆ moveCodeBlocks()

virtual ChangeStatus gtirb::SectionObserver::moveCodeBlocks ( Section S,
Section::code_block_range  Blocks 
)
pure virtual

Notify the parent when the addresses of existing CodeBlocks change.

Called after the Section updates its internal state.

Parameters
Sthe Section containing the CodeBlocks.
Blocksa range containing the CodeBlocks that moved.
Returns
indication of whether the observer accepts the change.

◆ moveDataBlocks()

virtual ChangeStatus gtirb::SectionObserver::moveDataBlocks ( Section S,
Section::data_block_range  Blocks 
)
pure virtual

Notify the parent when the addresses of existing DataBlocks change.

Called after the Section updates its internal state.

Parameters
Sthe Section containing the DataBlocks.
Blocksa range containing the DataBlocks that moved.
Returns
indication of whether the observer accepts the change.

◆ nameChange()

virtual ChangeStatus gtirb::SectionObserver::nameChange ( Section S,
const std::string &  OldName,
const std::string &  NewName 
)
pure virtual

Notify the parent when this Section's name changes.

Called after the Section updates its internal state.

Parameters
Sthe Section whose name changed.
OldNamethe Section's previous name.
NewNamethe new name of this section.
Returns
indication of whether the observer accepts the change.

◆ removeCodeBlocks()

virtual ChangeStatus gtirb::SectionObserver::removeCodeBlocks ( Section S,
Section::code_block_range  Blocks 
)
pure virtual

Notify the parent when CodeBlocks are removed from the Section.

Called before the Section updates its internal state.

Parameters
Sthe Section from which CodeBlocks will be removed.
Blocksa range containing the CodeBlocks to remove.
Returns
indication of whether the observer accepts the change.

◆ removeDataBlocks()

virtual ChangeStatus gtirb::SectionObserver::removeDataBlocks ( Section S,
Section::data_block_range  Blocks 
)
pure virtual

Notify the parent when DataBlocks are removed from the Section.

Called before the Section updates its internal state.

Parameters
Sthe Section from which DataBlocks will be removed.
Blocksa range containing the DataBlocks to remove.
Returns
indication of whether the observer accepts the change.

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