20#include <tlm_utils/instance_specific_extensions_int.h>
29template class tlm_array<tlm_utils::ispex_base *>;
41 typedef unsigned int key_type;
42 typedef std::map<std::type_index, key_type> type_map;
45 static ispex_registry &
56 register_extension(std::type_index type)
58 type_map::const_iterator it =
ids_.find(type);
60 if (it ==
ids_.end()) {
62 type_map::value_type
v(type,
static_cast<key_type
>(
ids_.size()));
72 return (
instance_) ? instance().ids_.size() : 0;
81ispex_registry *ispex_registry::instance_ =
nullptr;
86ispex_base::register_private_extension(
const std::type_info &type)
88 return ispex_registry::instance().register_extension(type);
95 static unsigned int max_num = 0;
125instance_specific_extension_container_pool::create()
131 unused = unused->
next;
136instance_specific_extension_container_pool::free(
143instance_specific_extension_container_pool::
144 ~instance_specific_extension_container_pool()
148 unused = unused->
next;
156instance_specific_extension_container::create()
158 return instance_specific_extension_container_pool::instance().
create();
161instance_specific_extension_container::
162 instance_specific_extension_container() :
163 use_count(0), m_txn(NULL), m_release_fn(NULL), m_carrier(NULL), next(NULL)
171 void *txn, release_fn *rel_fn)
238 unsigned int index)
const
256 m_extensions.expand(ispex_registry::max_num_extensions());
instance_specific_extension_accessor()
instance_specific_extension_container_pool()
void free(instance_specific_extension_container *)
static instance_specific_extension_container_pool & instance()
instance_specific_extension_container * unused
~instance_specific_extension_container()
std::vector< instance_specific_extensions_per_accessor * > m_ispex_per_accessor
void attach_carrier(instance_specific_extension_carrier *, void *txn, release_fn *)
instance_specific_extension_carrier * m_carrier
instance_specific_extensions_per_accessor * get_accessor(unsigned int index)
instance_specific_extension_container * next
release_fn * m_release_fn
friend class instance_specific_extensions_per_accessor
static instance_specific_extension_container * create()
container_type * m_container
void clear_extension(const T *)
tlm::tlm_array< ispex_base * > m_extensions
T * set_extension(T *ext)
void get_extension(T *&ext) const
static ispex_registry * instance_
static unsigned int max_num_ispex_accessors(bool increment=false)
unsigned int max_num_extensions()