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

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

#include <ByteInterval.hpp>

Public Member Functions

virtual ~ByteIntervalObserver ()=default
 
virtual ChangeStatus addCodeBlocks (ByteInterval *BI, ByteInterval::code_block_range Blocks)=0
 Notify the parent when new CodeBlocks are added to the interval. More...
 
virtual ChangeStatus addDataBlocks (ByteInterval *BI, ByteInterval::data_block_range Blocks)=0
 Notify the parent when new DataBlocks are added to the interval. More...
 
virtual ChangeStatus changeExtent (ByteInterval *BI, std::function< void(ByteInterval *)> Callback)=0
 Notify the parent when the range of addresses in the interval changes. More...
 
virtual ChangeStatus moveCodeBlocks (ByteInterval *BI, ByteInterval::code_block_range Blocks)=0
 Notify the parent when the addresses of existing CodeBlocks change. More...
 
virtual ChangeStatus moveDataBlocks (ByteInterval *BI, ByteInterval::data_block_range Blocks)=0
 Notify the parent when the addresses of existing CodeBlocks change. More...
 
virtual ChangeStatus removeCodeBlocks (ByteInterval *BI, ByteInterval::code_block_range Blocks)=0
 Notify the parent when CodeBlocks are removed from the interval. More...
 
virtual ChangeStatus removeDataBlocks (ByteInterval *BI, ByteInterval::data_block_range Blocks)=0
 Notify the parent when DataBlocks are removed from the interval. More...
 

Detailed Description

Interface for notifying observers when the ByteInterval is modified.

Constructor & Destructor Documentation

◆ ~ByteIntervalObserver()

virtual gtirb::ByteIntervalObserver::~ByteIntervalObserver ( )
virtualdefault

Member Function Documentation

◆ addCodeBlocks()

virtual ChangeStatus gtirb::ByteIntervalObserver::addCodeBlocks ( ByteInterval BI,
ByteInterval::code_block_range  Blocks 
)
pure virtual

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

Called after the ByteInterval updates its internal state.

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

◆ addDataBlocks()

virtual ChangeStatus gtirb::ByteIntervalObserver::addDataBlocks ( ByteInterval BI,
ByteInterval::data_block_range  Blocks 
)
pure virtual

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

Called after the ByteInterval updates its internal state.

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

◆ changeExtent()

virtual ChangeStatus gtirb::ByteIntervalObserver::changeExtent ( ByteInterval BI,
std::function< void(ByteInterval *)>  Callback 
)
pure virtual

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

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

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

◆ moveCodeBlocks()

virtual ChangeStatus gtirb::ByteIntervalObserver::moveCodeBlocks ( ByteInterval BI,
ByteInterval::code_block_range  Blocks 
)
pure virtual

Notify the parent when the addresses of existing CodeBlocks change.

Called after the ByteInterval updates its internal state.

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

◆ moveDataBlocks()

virtual ChangeStatus gtirb::ByteIntervalObserver::moveDataBlocks ( ByteInterval BI,
ByteInterval::data_block_range  Blocks 
)
pure virtual

Notify the parent when the addresses of existing CodeBlocks change.

Called after the ByteInterval updates its internal state.

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

◆ removeCodeBlocks()

virtual ChangeStatus gtirb::ByteIntervalObserver::removeCodeBlocks ( ByteInterval BI,
ByteInterval::code_block_range  Blocks 
)
pure virtual

Notify the parent when CodeBlocks are removed from the interval.

Called before the ByteInterval updates its internal state.

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

◆ removeDataBlocks()

virtual ChangeStatus gtirb::ByteIntervalObserver::removeDataBlocks ( ByteInterval BI,
ByteInterval::data_block_range  Blocks 
)
pure virtual

Notify the parent when DataBlocks are removed from the interval.

Called before the ByteInterval updates its internal state.

Parameters
BIthe ByteInterval from which the 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: