C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
simics::Connect< FirstIface, RestIfaces > Class Template Reference

A class for connecting with another Simics object. More...

#include <connect.h>

Inheritance diagram for simics::Connect< FirstIface, RestIfaces >:
simics::ConnectBase

Public Types

using ifaces_type = std::tuple< typename FirstIface::ToC, typename RestIfaces::ToC... >
 

Public Member Functions

 Connect ()=default
 
 Connect (const ConnectConfig &config)
 
 Connect (const ConfObjectRef &device)
 
 Connect (const ConfObjectRef &device, const ConnectConfig &config)
 
bool set (const ConfObjectRef &o) override
 Set the connected configuration object.
 
template<typename T >
std::enable_if< sizeof...(RestIfaces)!=0, consttypenameT::ToC >::type iface () const
 Return the Simics C++ interface struct implemented on obj_.
 
const FirstIface::ToC & iface () const
 
- Public Member Functions inherited from simics::ConnectBase
 ConnectBase ()
 
virtual ~ConnectBase ()=default
 
virtual bool set (const ConfObjectRef &o)=0
 Set the connected configuration object.
 
ConfObjectRef get () const
 Get the connected configuration object.
 
 operator conf_object_t * () const
 Conversion operator to conf_object_t*.
 

Protected Member Functions

conf_object_t * device () const
 Return the device object which can be used for logging purpose.
 
conf_object_t * dev () const
 Return the device object which can be used for logging purpose This is an alias for device() and follows the DML naming style.
 

Additional Inherited Members

- Protected Attributes inherited from simics::ConnectBase
ConfObjectRef obj_
 

Detailed Description

template<typename FirstIface, typename... RestIfaces>
class simics::Connect< FirstIface, RestIfaces >

A class for connecting with another Simics object.

The template parameter(s) should be a group of Simics device interfaces, e.g, simics::iface::SignalInterface.

When method set is called, the Simics C interface pointers are fetched and cached locally for performance reasons. Use method iface<T> when invoking the Simics device interface method. For convenience, method iface return the first Simics device interface.

Member Typedef Documentation

◆ ifaces_type

template<typename FirstIface , typename... RestIfaces>
using simics::Connect< FirstIface, RestIfaces >::ifaces_type = std::tuple<typename FirstIface::ToC, typename RestIfaces::ToC...>

Constructor & Destructor Documentation

◆ Connect() [1/4]

template<typename FirstIface , typename... RestIfaces>
simics::Connect< FirstIface, RestIfaces >::Connect ( )
default

◆ Connect() [2/4]

template<typename FirstIface , typename... RestIfaces>
simics::Connect< FirstIface, RestIfaces >::Connect ( const ConnectConfig config)
inlineexplicit

◆ Connect() [3/4]

template<typename FirstIface , typename... RestIfaces>
simics::Connect< FirstIface, RestIfaces >::Connect ( const ConfObjectRef device)
inlineexplicit

◆ Connect() [4/4]

template<typename FirstIface , typename... RestIfaces>
simics::Connect< FirstIface, RestIfaces >::Connect ( const ConfObjectRef device,
const ConnectConfig config 
)
inline

Member Function Documentation

◆ dev()

template<typename FirstIface , typename... RestIfaces>
conf_object_t * simics::Connect< FirstIface, RestIfaces >::dev ( ) const
inlineprotected

Return the device object which can be used for logging purpose This is an alias for device() and follows the DML naming style.

◆ device()

template<typename FirstIface , typename... RestIfaces>
conf_object_t * simics::Connect< FirstIface, RestIfaces >::device ( ) const
inlineprotected

Return the device object which can be used for logging purpose.

◆ iface() [1/2]

template<typename FirstIface , typename... RestIfaces>
template<typename T >
std::enable_if< sizeof...(RestIfaces)!=0, consttypenameT::ToC >::type simics::Connect< FirstIface, RestIfaces >::iface ( ) const
inline

Return the Simics C++ interface struct implemented on obj_.

Check if this Connect is set before calling this method. When this Connect is set, it is guaranteed that a valid Simics C++ interface struct is returned.

◆ iface() [2/2]

template<typename FirstIface , typename... RestIfaces>
const FirstIface::ToC & simics::Connect< FirstIface, RestIfaces >::iface ( ) const
inline

◆ set()

template<typename FirstIface , typename... RestIfaces>
bool simics::Connect< FirstIface, RestIfaces >::set ( const ConfObjectRef o)
inlineoverridevirtual

Set the connected configuration object.

Parameters
oThe configuration object to connect.
Returns
True if the connection was successful, false otherwise.

Implements simics::ConnectBase.


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