C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
simics::ConfClass Class Reference

Represents Simics C type conf_class_t. More...

#include <conf-class.h>

Public Member Functions

 ConfClass (const ConfClass &)=delete
 Avoid implicit copy.
 
ConfClassoperator= (const ConfClass &)=delete
 
virtual ~ConfClass ()
 
 operator conf_class_t * () const
 Get a pointer to the configuration class represented.
 
const std::string & name () const
 Return the class name.
 
const std::string & description () const
 Return the class description.
 
const std::vector< std::string > & log_groups () const
 Return the class log groups.
 
ConfClassadd (const iface::InterfaceInfo &iface)
 Stores the provided InterfaceInfo for later registration.
 
ConfClassadd (const Attribute &attr)
 A function to add an attribute to the set of attributes of ConfClass.
 
ConfClassadd (const ClassAttribute &attr)
 
ConfClassadd (const char *const *names)
 Functions to add log groups that an object can use to separate messages.
 
ConfClassadd (const LogGroups &names)
 
ConfClassadd (ConfClass *port, const std::string &name)
 A function to add a port object to the set of ports defined by the class.
 
ConfClassadd (const ConfClassPtr &port, const std::string &name)
 
ConfClassadd (EventInfo &&event)
 A function to add an event to the set of events of ConfClass.
 

Static Public Member Functions

static ConfClassPtr createInstance (const std::string &name, const std::string &short_desc, const std::string &description, const class_kind_t kind, const ObjectFactoryInterface &factory)
 Factory function to create a ConfClass instance All parameters except the last one is used to call the Simics C API SIM_create_class.
 
static uint64 getGroupId (conf_class_t *cls, const std::string &name)
 Return the ID of a log group.
 

Protected Member Functions

 ConfClass (conf_class_t *cls, const std::string &name, const std::string &description)
 Must use factory method to create instance.
 

Detailed Description

Represents Simics C type conf_class_t.

This class serves as a wrapper around a conf_class_t pointer, providing comprehensive support for the registration of attributes, interfaces, log groups, and ports.

Instances of this class cannot be created using a default constructor, as a valid conf_class_t pointer is required for initialization. To ensure proper setup and validation, the class employs a static factory function, createInstance, as the sole method for instantiation.

Constructor & Destructor Documentation

◆ ConfClass() [1/2]

simics::ConfClass::ConfClass ( const ConfClass )
delete

Avoid implicit copy.

◆ ~ConfClass()

virtual simics::ConfClass::~ConfClass ( )
virtual

◆ ConfClass() [2/2]

simics::ConfClass::ConfClass ( conf_class_t *  cls,
const std::string &  name,
const std::string &  description 
)
inlineexplicitprotected

Must use factory method to create instance.

Member Function Documentation

◆ add() [1/8]

ConfClass * simics::ConfClass::add ( ConfClass port,
const std::string &  name 
)

A function to add a port object to the set of ports defined by the class.

See also
SIM_register_port
Parameters
porta ConfClass to be used as port object
namethe name of the port object
Returns
ConfClass this pointer

If the name contains a pair of brackets, for instance, "port.array[2]" registers a port array with two ports "port.array[0]" and "port.array[1]" Multidimensional array format is not supported

◆ add() [2/8]

ConfClass * simics::ConfClass::add ( const Attribute attr)

A function to add an attribute to the set of attributes of ConfClass.

See also
SIM_register_attribute, SIM_register_class_attribute
Parameters
attran Attribute used for adding an attribute.
Returns
ConfClass this pointer

◆ add() [3/8]

ConfClass * simics::ConfClass::add ( const char *const *  names)

Functions to add log groups that an object can use to separate messages.

A class may have up to 63 user-defined log groups. The Simics log groups can be registered either by calling these functions one or more times, or by calling the SIM_log_register_groups C API function directly. It is not permitted to use both of them in one ConfClass.

Parameters
nameseither a NULL-terminated array or a list of strings contains names of the log groups
Returns
ConfClass this pointer

◆ add() [4/8]

ConfClass * simics::ConfClass::add ( const ClassAttribute attr)

◆ add() [5/8]

ConfClass * simics::ConfClass::add ( const ConfClassPtr port,
const std::string &  name 
)

◆ add() [6/8]

ConfClass * simics::ConfClass::add ( const iface::InterfaceInfo iface)

Stores the provided InterfaceInfo for later registration.

The actual registration with SIM_register_interface will be performed when the ConfClass object is destroyed.

See also
SIM_register_interface
Parameters
ifacea Registry used for interface registration.
Returns
ConfClass this pointer

◆ add() [7/8]

ConfClass * simics::ConfClass::add ( const LogGroups names)

◆ add() [8/8]

ConfClass * simics::ConfClass::add ( EventInfo &&  event)

A function to add an event to the set of events of ConfClass.

See also
SIM_register_event
Parameters
eventthe event to be registered on the class
Returns
ConfClass this pointer

◆ createInstance()

static ConfClassPtr simics::ConfClass::createInstance ( const std::string &  name,
const std::string &  short_desc,
const std::string &  description,
const class_kind_t  kind,
const ObjectFactoryInterface factory 
)
static

Factory function to create a ConfClass instance All parameters except the last one is used to call the Simics C API SIM_create_class.

May raise runtime_error if the creation failed.

See also
SIM_create_class
Parameters
factoryan interface to create ConfObject.
Returns
a ConfClassPtr

◆ description()

const std::string & simics::ConfClass::description ( ) const

Return the class description.

◆ getGroupId()

static uint64 simics::ConfClass::getGroupId ( conf_class_t *  cls,
const std::string &  name 
)
static

Return the ID of a log group.

◆ log_groups()

const std::vector< std::string > & simics::ConfClass::log_groups ( ) const

Return the class log groups.

◆ name()

const std::string & simics::ConfClass::name ( ) const

Return the class name.

◆ operator conf_class_t *()

simics::ConfClass::operator conf_class_t * ( ) const

Get a pointer to the configuration class represented.

◆ operator=()

ConfClass & simics::ConfClass::operator= ( const ConfClass )
delete

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