GTIRB  v2.2.0
GrammaTech Intermediate Representation for Binaries: C++ API
Classes | List of all members
gtirb::AuxDataContainer Class Reference

Contains the AuxData Tables and serves as a base class. More...

#include <AuxDataContainer.hpp>

Inheritance diagram for gtirb::AuxDataContainer:
Inheritance graph
[legend]
Collaboration diagram for gtirb::AuxDataContainer:
Collaboration graph
[legend]

Classes

struct  AuxDataRaw
 An interface for accessing the serialized form of an AuxData instance. More...
 

AuxData Properties

using const_aux_data_iterator = boost::transform_iterator< AccessRawData, AuxDataSet::const_iterator >
 An iterator type for traversing the AuxData in this container. More...
 
using const_aux_data_range = boost::iterator_range< const_aux_data_iterator >
 
template<typename Schema >
static void registerAuxDataType ()
 Register a type to be used with AuxData of the given name. More...
 
template<typename Schema >
void addAuxData (typename Schema::Type &&X)
 Add a new AuxData, transferring ownership. More...
 
template<typename Schema >
Schema::Type * getAuxData ()
 Get a reference to the underlying type stored in the AuxData by name. More...
 
template<typename Schema >
const Schema::Type * getAuxData () const
 Get a reference to the underlying type stored in the AuxData by name. More...
 
template<typename Schema >
bool removeAuxData ()
 Remove an AuxData by schema. More...
 
bool removeAuxData (std::string Name)
 Remove an AuxData by name. More...
 
const_aux_data_iterator aux_data_begin () const
 Return a constant iterator to the first AuxData. More...
 
const_aux_data_iterator aux_data_end () const
 Return a constant iterator to the element following the last AuxData. More...
 
const_aux_data_range aux_data () const
 Return a constant range of the auxiliary data (AuxData). More...
 
size_t getAuxDataSize () const
 Get the total number of AuxData objects in this IR. More...
 
bool getAuxDataEmpty () const
 Check: Is the number of AuxData objects in this IR zero? More...
 
void clearAuxData ()
 Clear all AuxData from the IR. More...
 

Additional Inherited Members

- 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 UUIDgetUUID () const
 Get the Universally Unique ID (UUID) for this. More...
 
Nodeoperator= (const Node &)=delete
 Copying Nodes is explicilty disabled. More...
 
Nodeoperator= (Node &&)=delete
 Move-assigning Nodes is explicilty disabled. More...
 
- Static Public Member Functions inherited from gtirb::Node
static NodeCreate (Context &C)
 Create a Node object in its default state. More...
 
static const NodegetByUUID (const Context &C, const UUID &Uuid)
 Retrieve a node by its UUID. More...
 
static NodegetByUUID (Context &C, const UUID &Uuid)
 Retrieve a node by its UUID. More...
 

Detailed Description

Contains the AuxData Tables and serves as a base class.

Member Typedef Documentation

◆ const_aux_data_iterator

using gtirb::AuxDataContainer::const_aux_data_iterator = boost::transform_iterator<AccessRawData, AuxDataSet::const_iterator>

An iterator type for traversing the AuxData in this container.

The value type for this iterator is AuxDataRaw. The iterator provides access to the serialized form of all AuxData in this container (regardless of whether or not the AuxData's type is registered.) Note that the content is only valid with respect to the most recent unserialization operation. Entries for new or modified AuxData entities will contain empty or stale content.

◆ const_aux_data_range

Member Function Documentation

◆ addAuxData()

template<typename Schema >
void gtirb::AuxDataContainer::addAuxData ( typename Schema::Type &&  X)
inline

Add a new AuxData, transferring ownership.

Parameters
XThe data itself.
Returns
void

◆ aux_data()

const_aux_data_range gtirb::AuxDataContainer::aux_data ( ) const
inline

Return a constant range of the auxiliary data (AuxData).

◆ aux_data_begin()

const_aux_data_iterator gtirb::AuxDataContainer::aux_data_begin ( ) const
inline

Return a constant iterator to the first AuxData.

◆ aux_data_end()

const_aux_data_iterator gtirb::AuxDataContainer::aux_data_end ( ) const
inline

Return a constant iterator to the element following the last AuxData.

◆ clearAuxData()

void gtirb::AuxDataContainer::clearAuxData ( )
inline

Clear all AuxData from the IR.

Returns
void

◆ getAuxData() [1/2]

template<typename Schema >
Schema::Type* gtirb::AuxDataContainer::getAuxData ( )
inline

Get a reference to the underlying type stored in the AuxData by name.

Returns
A non-owning pointer to the data if found, nullptr otherwise.

Note that this function can only be used for AuxData for which a type has been registered with registerAuxDataType().

◆ getAuxData() [2/2]

template<typename Schema >
const Schema::Type* gtirb::AuxDataContainer::getAuxData ( ) const
inline

Get a reference to the underlying type stored in the AuxData by name.

Returns
A non-owning pointer to the data if found, nullptr otherwise.

Note that this function can only be used for AuxData for which a type has been registered with registerAuxDataType().

◆ getAuxDataEmpty()

bool gtirb::AuxDataContainer::getAuxDataEmpty ( ) const
inline

Check: Is the number of AuxData objects in this IR zero?

Returns
true if this IR does not contain any AuxData, otherwise false

◆ getAuxDataSize()

size_t gtirb::AuxDataContainer::getAuxDataSize ( ) const
inline

Get the total number of AuxData objects in this IR.

Returns
The total number of AuxData objects.

◆ registerAuxDataType()

template<typename Schema >
static void gtirb::AuxDataContainer::registerAuxDataType ( )
inlinestatic

Register a type to be used with AuxData of the given name.

◆ removeAuxData() [1/2]

template<typename Schema >
bool gtirb::AuxDataContainer::removeAuxData ( )
inline

Remove an AuxData by schema.

This will invalidate any pointers that may have been held externally.

Returns
true on success, false otherwise.

Note that this function can only be used for AuxData for which a type has been registered with registerAuxDataType().

◆ removeAuxData() [2/2]

bool gtirb::AuxDataContainer::removeAuxData ( std::string  Name)
inline

Remove an AuxData by name.

This will invalidate any pointers that may have been held externally.

Returns
true on success, false otherwise.

Note that this function can be used for any AuxData regardless of whether or not it has a registered schema.


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