C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
simics::ObjectFactoryWithArg< T, A > Class Template Reference

A factory for creating instances of ConfObject-derived classes with an argument. More...

#include <object-factory.h>

Inheritance diagram for simics::ObjectFactoryWithArg< T, A >:
simics::ObjectFactoryInterface

Public Member Functions

 ObjectFactoryWithArg (A *arg)
 
ConfObjectcreate (conf_object_t *obj) const override
 Creates an instance of the ConfObject-derived class with an argument.
 
ObjectFactoryInterfaceclone () const override
 Clones the current ObjectFactoryWithArg instance.
 
- Public Member Functions inherited from simics::ObjectFactoryInterface
virtual ~ObjectFactoryInterface ()=default
 
virtual ConfObjectcreate (conf_object_t *obj) const =0
 Creates a ConfObject instance from a conf_object_t pointer.
 
virtual ObjectFactoryInterfaceclone () const =0
 Clones the current ObjectFactoryInterface instance.
 

Detailed Description

template<typename T, typename A>
class simics::ObjectFactoryWithArg< T, A >

A factory for creating instances of ConfObject-derived classes with an argument.

The ObjectFactoryWithArg class template provides a factory for creating instances of classes derived from ConfObject, with an additional argument passed to the constructor. It implements the ObjectFactoryInterface.

Template Parameters
TThe type of the ConfObject-derived class to be created.
AThe type of the additional argument to be passed to the constructor.

Constructor & Destructor Documentation

◆ ObjectFactoryWithArg()

template<typename T , typename A >
simics::ObjectFactoryWithArg< T, A >::ObjectFactoryWithArg ( A *  arg)
inlineexplicit

Member Function Documentation

◆ clone()

template<typename T , typename A >
ObjectFactoryInterface * simics::ObjectFactoryWithArg< T, A >::clone ( ) const
inlineoverridevirtual

Clones the current ObjectFactoryWithArg instance.

This function creates and returns a copy of the current ObjectFactoryWithArg instance.

Returns
Pointer to a cloned ObjectFactoryWithArg instance.

Implements simics::ObjectFactoryInterface.

◆ create()

template<typename T , typename A >
ConfObject * simics::ObjectFactoryWithArg< T, A >::create ( conf_object_t *  obj) const
inlineoverridevirtual

Creates an instance of the ConfObject-derived class with an argument.

This function creates and returns a new instance of the ConfObject-derived class using the provided conf_object_t pointer and the additional argument.

Parameters
objPointer to a conf_object_t instance.
Returns
Pointer to a newly created ConfObject-derived instance.

Implements simics::ObjectFactoryInterface.


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