14#ifndef SIMICS_SYSTEMC_INJECTION_INJECT_REGISTRY_H
15#define SIMICS_SYSTEMC_INJECTION_INJECT_REGISTRY_H
34template <
typename TPAYLOAD>
38 gp_ =
new TPAYLOAD(
this);
40 attr_value_t attrCopy = SIM_attr_copy(*attr);
41 gpAttrCopies_.emplace(gp_, attrCopy);
60 struct ReleasedInvoker {
67 void free(tlm::tlm_generic_payload *gp)
override {
69 Registry<InjectInterface<TPAYLOAD> >::instance()->reverseIterate(
72 typename std::map<TPAYLOAD *, attr_value_t>::iterator i;
73 i = gpAttrCopies_.find(gp);
74 if (i != gpAttrCopies_.end()) {
75 SIM_attr_free(&i->second);
76 gpAttrCopies_.erase(i);
83 ReleasedInvoker released_;
84 AttrDictParser *parser_;
85 std::map<TPAYLOAD *, attr_value_t> gpAttrCopies_;
Definition: registry.h:30
bool reverseIterate(F *f)
Definition: registry.h:60
Definition: attr_dict_parser.h:38
bool reportInvalidAttrs()
Definition: inject_interface.h:25
virtual void released(TPAYLOAD *gp)=0
virtual void attrToValue(AttrDictParser *parser, TPAYLOAD *gp)=0
Definition: inject_registry.h:35
bool operator()(InjectInterface< TPAYLOAD > *iface)
Definition: inject_registry.h:54
TPAYLOAD * attrToPayload(conf_object_t *obj, attr_value_t *attr)
Definition: inject_registry.h:37