gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::Extensible< Target > Class Template Reference

#include <extensible.hh>

Public Member Functions

 Extensible ()=default
 
 Extensible (const Extensible &other)
 
virtual ~Extensible ()=default
 
template<typename T >
void setExtension (std::shared_ptr< T > ext)
 Set a new extension to the packet and replace the old one, if there already exists the same type of extension in this packet.
 
template<typename T >
void removeExtension (void)
 Remove the extension based on its type.
 
template<typename T >
std::shared_ptr< T > getExtension ()
 Get the extension pointer by linear search with the extensionID.
 

Protected Member Functions

template<typename T >
std::list< std::shared_ptr< ExtensionBase > >::iterator findExtension ()
 Go through the extension list and return the iterator to the instance of the type of extension.
 

Protected Attributes

std::list< std::shared_ptr< ExtensionBase > > extensions
 

Detailed Description

template<typename Target>
class gem5::Extensible< Target >

Definition at line 120 of file extensible.hh.

Constructor & Destructor Documentation

◆ Extensible() [1/2]

template<typename Target >
gem5::Extensible< Target >::Extensible ( )
default

◆ Extensible() [2/2]

template<typename Target >
gem5::Extensible< Target >::Extensible ( const Extensible< Target > & other)
inline

Definition at line 124 of file extensible.hh.

References gem5::ArmISA::ext, and gem5::Extensible< Target >::extensions.

◆ ~Extensible()

template<typename Target >
virtual gem5::Extensible< Target >::~Extensible ( )
virtualdefault

Member Function Documentation

◆ findExtension()

template<typename Target >
template<typename T >
std::list< std::shared_ptr< ExtensionBase > >::iterator gem5::Extensible< Target >::findExtension ( )
inlineprotected

Go through the extension list and return the iterator to the instance of the type of extension.

If there is no such an extension, return the end iterator of the list.

Returns
The iterator to the extension type T if there exists.

Definition at line 203 of file extensible.hh.

References gem5::Extensible< Target >::extensions.

Referenced by gem5::Extensible< Target >::getExtension(), gem5::Extensible< Target >::removeExtension(), and gem5::Extensible< Target >::setExtension().

◆ getExtension()

template<typename Target >
template<typename T >
std::shared_ptr< T > gem5::Extensible< Target >::getExtension ( )
inline

Get the extension pointer by linear search with the extensionID.

Definition at line 182 of file extensible.hh.

References gem5::Extensible< Target >::extensions, and gem5::Extensible< Target >::findExtension().

Referenced by gem5::RequestPort::addTrace(), gem5::BaseXBar::findPort(), and gem5::RequestPort::removeTrace().

◆ removeExtension()

template<typename Target >
template<typename T >
void gem5::Extensible< Target >::removeExtension ( void )
inline

Remove the extension based on its type.

Parameters
extExtension to remove

Definition at line 167 of file extensible.hh.

References gem5::Extensible< Target >::extensions, and gem5::Extensible< Target >::findExtension().

◆ setExtension()

template<typename Target >
template<typename T >
void gem5::Extensible< Target >::setExtension ( std::shared_ptr< T > ext)
inline

Set a new extension to the packet and replace the old one, if there already exists the same type of extension in this packet.

This new extension will be deleted automatically with the shared_ptr<>.

Parameters
extExtension to set

Definition at line 142 of file extensible.hh.

References gem5::ArmISA::ext, gem5::Extensible< Target >::extensions, and gem5::Extensible< Target >::findExtension().

Referenced by gem5::RequestPort::addTrace().

Member Data Documentation

◆ extensions


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

Generated on Tue Jun 18 2024 16:24:11 for gem5 by doxygen 1.11.0