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

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

#include <object-factory.h>

Inheritance diagram for simics::ObjectFactory< T >:
simics::ObjectFactoryInterface

Public Member Functions

 ObjectFactory ()=default
 
ConfObjectcreate (conf_object_t *obj) const override
 Creates an instance of the ConfObject-derived class.
 
ObjectFactoryInterfaceclone () const override
 Clones the current ObjectFactory 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>
class simics::ObjectFactory< T >

A factory for creating instances of ConfObject-derived classes.

The ObjectFactory class template provides a factory for creating instances of classes derived from ConfObject. It implements the ObjectFactoryInterface.

Template Parameters
TThe type of the ConfObject-derived class to be created.

Constructor & Destructor Documentation

◆ ObjectFactory()

template<typename T >
simics::ObjectFactory< T >::ObjectFactory ( )
default

Member Function Documentation

◆ clone()

template<typename T >
ObjectFactoryInterface * simics::ObjectFactory< T >::clone ( ) const
inlineoverridevirtual

Clones the current ObjectFactory instance.

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

Returns
Pointer to a cloned ObjectFactory instance.

Implements simics::ObjectFactoryInterface.

◆ create()

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

Creates an instance of the ConfObject-derived class.

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

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: