44template <
typename TParent>
52 throw std::invalid_argument(
53 "ConfObjectRef passed to Port constructor is null");
56 parent_ = from_obj<ParentType>(parent_conf_obj());
58 strlen(SIM_object_name(parent_conf_obj())) + 1);
70 const std::string &
name()
const {
82 conf_object_t *parent_conf_obj() {
83 auto p = SIM_port_object_parent(
obj());
85 throw std::runtime_error {
86 "The object " +
obj().
name() +
" is not a port object"
93 TParent *parent_ {
nullptr};
95 std::string name_ {
""};
Represents Simics C type conf_object_t.
Definition: conf-object.h:38
conf_object_t * object() const
Get a pointer to the configuration object represented by this ConfObjectRef.
Definition: conf-object.h:54
std::string name() const
Get the name of the underlying configuration object.
Base class for all Simics configuration objects.
Definition: conf-object.h:126
ConfObjectRef obj() const
Return a ConfObjectRef represents this object.
Definition: conf-object.h:137
Extends ConfObject to add utilities to a Simics port object.
Definition: port.h:45
TParent ParentType
Definition: port.h:47
Port(const ConfObjectRef &obj)
Definition: port.h:49
int index() const
Definition: port.h:76
const std::string & name() const
Definition: port.h:70
ParentType * parent() const
Definition: port.h:65
Definition: after-bank.h:33
int array_index(const std::string &name)
This function looks for a pattern in the input string that resembles an array index,...