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

virtual ~ConfClass ()
 
 ConfClass (const ConfClass &)=delete
 Avoid implicit copy.
 
ConfClassoperator= (const ConfClass &)=delete
 
 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)
 A function to register that ConfClass implements the iface interface.
 
ConfClassadd (const Attribute &attr)
 A function to add an attribute to the set of attributes of ConfClass.
 
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 iface::ObjectFactoryInterface &factory)
 A function to create a ConfClass instance All parameters except the last one is used to call the Simics C API SIM_create_class.
 

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.

It wraps around a conf_class_t pointer and provides registration support for attribute, interface, log group and port.

No default constructor as it requires a valid pointer of conf_class_t. The only way to create an instance is by calling the function create.

Constructor & Destructor Documentation

◆ ~ConfClass()

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

◆ ConfClass() [1/2]

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

Avoid implicit copy.

◆ 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/7]

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/7]

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
Parameters
attran Attribute used for adding an attribute.
Returns
ConfClass this pointer

◆ add() [3/7]

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/7]

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

◆ add() [5/7]

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

A function to register that ConfClass implements the iface interface.

May raise runtime_error if the registration failed.

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

◆ add() [6/7]

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

◆ add() [7/7]

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 iface::ObjectFactoryInterface factory 
)
static

A 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
inline

Return the class description.

◆ log_groups()

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

Return the class log groups.

◆ name()

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

Return the class name.

◆ operator conf_class_t *()

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

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: