C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
simics::Port< TParent > Class Template Reference

Extends ConfObject to add utilities to a Simics port object. More...

#include <port.h>

Inheritance diagram for simics::Port< TParent >:
simics::ConfObject simics::ConfObjectInterface simics::BankPort< GeneratedRegisterDevice > simics::BankPort< SampleDevice > simics::BankPort< MappableConfObject > simics::BankPort< TParent > SampleBankPort SampleBankPortManual simics::SimpleBankPort< TPortBank, Args >

Public Types

using ParentType = TParent
 

Public Member Functions

 Port (const ConfObjectRef &obj)
 
virtual ~Port ()=default
 
ParentTypeparent () const
 
const std::string & name () const
 
int index () const
 
- Public Member Functions inherited from simics::ConfObject
 ConfObject (const ConfObjectRef &obj)
 Create a ConfObject from ConfObjectRef.
 
virtual ~ConfObject ()=default
 
void finalize () override
 
void objects_finalized () override
 
ConfObjectRef obj () const
 Return a ConfObjectRef represents this object.
 
virtual bool finalized ()
 Return if the finalize method has been called.
 
- Public Member Functions inherited from simics::ConfObjectInterface
virtual ~ConfObjectInterface ()=default
 
virtual void finalize ()=0
 
virtual void objects_finalized ()=0
 

Detailed Description

template<typename TParent>
class simics::Port< TParent >

Extends ConfObject to add utilities to a Simics port object.

A class inherited the ConfObject class can be registered as a port object. A port object is a child object of a parent object, which is created automatically together with its parent object. This class provides utilities to access the parent object and the index of the port object array.

Template Parameters
TParentThe parent class of the port object TParent is the template class typename for Port, typically representing the C++ class of the port's parent. A complete definition of TParent is necessary, so it is advisable to define the port class after the TParent class or as an inner class within TParent to ensure proper access to its private members. If the port class does not need to access the parent's class members, you can use ConfObject as TParent to eliminate dependencies on the parent C++ class. Or simply use ConfObject as the parent class.

Member Typedef Documentation

◆ ParentType

template<typename TParent >
using simics::Port< TParent >::ParentType = TParent

Constructor & Destructor Documentation

◆ Port()

template<typename TParent >
simics::Port< TParent >::Port ( const ConfObjectRef obj)
inlineexplicit

◆ ~Port()

template<typename TParent >
virtual simics::Port< TParent >::~Port ( )
virtualdefault

Member Function Documentation

◆ index()

template<typename TParent >
int simics::Port< TParent >::index ( ) const
inline
Returns
the index of port object array Returns -1 if the port object is not an array or has invalid index

◆ name()

template<typename TParent >
const std::string & simics::Port< TParent >::name ( ) const
inline
Returns
the name of the port only

◆ parent()

template<typename TParent >
ParentType * simics::Port< TParent >::parent ( ) const
inline
Returns
a pointer to the C++ object associated with the Simics parent object

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