GTIRB
v2.2.0
GrammaTech Intermediate Representation for Binaries: C++ API
|
Represents a data object, possibly symbolic. More...
#include <DataBlock.hpp>
Public Types | |
template<typename T > | |
using | bytes_iterator = ByteInterval::bytes_iterator< T > |
Iterator over bytes in this block. More... | |
template<typename T > | |
using | bytes_range = ByteInterval::bytes_range< T > |
Range over bytes in this block. More... | |
template<typename T > | |
using | const_bytes_iterator = ByteInterval::const_bytes_iterator< T > |
Const iterator over bytes in this block. More... | |
template<typename T > | |
using | const_bytes_range = ByteInterval::const_bytes_range< T > |
Const range over bytes in this block. More... | |
Public Member Functions | |
template<typename T > | |
bytes_range< T > | bytes () |
Get a range of the bytes in this block. More... | |
template<typename T > | |
const_bytes_range< T > | bytes () const |
Get a range of the bytes in this block. More... | |
template<typename T > | |
bytes_range< T > | bytes (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) |
Get a range of the bytes in this block. More... | |
template<typename T > | |
const_bytes_range< T > | bytes (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) const |
Get a range of the bytes in this block. More... | |
template<typename T > | |
bytes_iterator< T > | bytes_begin () |
Get an iterator to the first byte in this block. More... | |
template<typename T > | |
const_bytes_iterator< T > | bytes_begin () const |
Get an iterator to the first byte in this block. More... | |
template<typename T > | |
bytes_iterator< T > | bytes_begin (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) |
Get an iterator to the first byte in this block. More... | |
template<typename T > | |
const_bytes_iterator< T > | bytes_begin (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) const |
Get an iterator to the first byte in this block. More... | |
template<typename T > | |
bytes_iterator< T > | bytes_end () |
Get an iterator past the last byte in this block. More... | |
template<typename T > | |
const_bytes_iterator< T > | bytes_end () const |
Get an iterator past the last byte in this block. More... | |
template<typename T > | |
bytes_iterator< T > | bytes_end (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) |
Get an iterator past the last byte in this block. More... | |
template<typename T > | |
const_bytes_iterator< T > | bytes_end (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) const |
Get an iterator past the last byte in this block. More... | |
std::optional< Addr > | getAddress () const |
Get the address of this block, if present. See ByteInterval::getAddress for details on why this address may not be present. More... | |
ByteInterval * | getByteInterval () |
Get the ByteInterval this block belongs to. More... | |
const ByteInterval * | getByteInterval () const |
Get the ByteInterval this block belongs to. More... | |
uint64_t | getOffset () const |
Get the offset from the beginning of the ByteInterval this block belongs to. More... | |
uint64_t | getSize () const |
Get the size of a DataBlock. More... | |
template<typename T > | |
T * | rawBytes () |
Return the raw data underlying this block's byte vector. More... | |
template<typename T > | |
const T * | rawBytes () const |
Return the raw data underlying this block's byte vector. More... | |
void | setSize (uint64_t S) |
Set the size of this block. More... | |
Public Member Functions inherited from gtirb::Node | |
Node (const Node &)=delete | |
Copying Nodes is explicitly disabled. More... | |
Node (Node &&)=delete | |
Move-constructing Nodes is explicitly disabled. More... | |
~Node () noexcept | |
Cleans up resources no longer needed by the Node object. More... | |
const UUID & | getUUID () const |
Get the Universally Unique ID (UUID) for this . More... | |
Node & | operator= (const Node &)=delete |
Copying Nodes is explicilty disabled. More... | |
Node & | operator= (Node &&)=delete |
Move-assigning Nodes is explicilty disabled. More... | |
Static Public Member Functions | |
static DataBlock * | Create (Context &C) |
Create an unitialized DataBlock object. More... | |
static DataBlock * | Create (Context &C, uint64_t Size) |
Create a DataBlock object. More... | |
Static Public Member Functions inherited from gtirb::Node | |
static Node * | Create (Context &C) |
Create a Node object in its default state. More... | |
static const Node * | getByUUID (const Context &C, const UUID &Uuid) |
Retrieve a node by its UUID. More... | |
static Node * | getByUUID (Context &C, const UUID &Uuid) |
Retrieve a node by its UUID. More... | |
Friends | |
class | ByteInterval |
class | Context |
class | SerializationTestHarness |
Represents a data object, possibly symbolic.
Does not directly store the data bytes, which are kept in the ImageByteMap.
using gtirb::DataBlock::bytes_iterator = ByteInterval::bytes_iterator<T> |
Iterator over bytes in this block.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
using gtirb::DataBlock::bytes_range = ByteInterval::bytes_range<T> |
Range over bytes in this block.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
using gtirb::DataBlock::const_bytes_iterator = ByteInterval::const_bytes_iterator<T> |
Const iterator over bytes in this block.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
using gtirb::DataBlock::const_bytes_range = ByteInterval::const_bytes_range<T> |
Const range over bytes in this block.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get a range of the bytes in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get a range of the bytes in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get a range of the bytes in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the block. |
OutputOrder | The endianness you wish to read out from the block. |
|
inline |
Get a range of the bytes in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the block. |
OutputOrder | The endianness you wish to read out from the block. |
|
inline |
Get an iterator to the first byte in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get an iterator to the first byte in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get an iterator to the first byte in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the block. |
OutputOrder | The endianness you wish to read out from the block. |
|
inline |
Get an iterator to the first byte in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the block. |
OutputOrder | The endianness you wish to read out from the block. |
|
inline |
Get an iterator past the last byte in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get an iterator past the last byte in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get an iterator past the last byte in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the block. |
OutputOrder | The endianness you wish to read out from the block. |
|
inline |
Get an iterator past the last byte in this block.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
T | The type of data stored in this block's byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the block. |
OutputOrder | The endianness you wish to read out from the block. |
std::optional<Addr> gtirb::DataBlock::getAddress | ( | ) | const |
Get the address of this block, if present. See ByteInterval::getAddress for details on why this address may not be present.
|
inline |
Get the ByteInterval this block belongs to.
|
inline |
Get the ByteInterval this block belongs to.
uint64_t gtirb::DataBlock::getOffset | ( | ) | const |
Get the offset from the beginning of the ByteInterval this block belongs to.
|
inline |
Get the size of a DataBlock.
|
inline |
Return the raw data underlying this block's byte vector.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
Much like std::vector::data, this function is low-level and potentially unsafe. This pointer refers to valid memory only where an iterator would be valid to point to. Modifying the size of the byte vector may invalidate this pointer. Any endian conversions will not be performed.
T | The type of data stored in this block's byte vector. Must be a POD type. |
\retrurn A pointer to raw data.
|
inline |
Return the raw data underlying this block's byte vector.
If this block is not associated with any ByteInterval, than the behavior of this function is undefined.
Much like std::vector::data, this function is low-level and potentially unsafe. This pointer refers to valid memory only where an iterator would be valid to point to. Modifying the size of the byte vector may invalidate this pointer. Any endian conversions will not be performed.
T | The type of data stored in this block's byte vector. Must be a POD type. |
\retrurn A pointer to raw data.
|
inline |
Set the size of this block.
Note that this does not automatically update any ByteInterval's size, bytes, or symbolic expressions. This simply changes the extents of a block in its ByteInterval.
|
friend |
|
friend |
|
friend |