Rename ephash to entity_index/entidx
It is now more than just a GUID hash so "ephash" really doesn't fit anymore. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
		
							parent
							
								
									2dfde4bf0d
								
							
						
					
					
						commit
						0271c11144
					
				
					 31 changed files with 523 additions and 527 deletions
				
			
		| 
						 | 
				
			
			@ -19,7 +19,7 @@
 | 
			
		|||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
struct whc *builtintopic_whc_new (enum ddsi_sertopic_builtintopic_type type, const struct ephash *guid_hash);
 | 
			
		||||
struct whc *builtintopic_whc_new (enum ddsi_sertopic_builtintopic_type type, const struct entity_index *entidx);
 | 
			
		||||
 | 
			
		||||
#if defined (__cplusplus)
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -258,7 +258,7 @@ void dds__builtin_init (struct dds_domain *dom)
 | 
			
		|||
  dom->builtin_writer_topic = new_sertopic_builtintopic (DSBT_WRITER, "DCPSPublication", "org::eclipse::cyclonedds::builtin::DCPSPublication", &dom->gv);
 | 
			
		||||
 | 
			
		||||
  thread_state_awake (lookup_thread_state (), &dom->gv);
 | 
			
		||||
  const struct ephash *gh = dom->gv.guid_hash;
 | 
			
		||||
  const struct entity_index *gh = dom->gv.entity_index;
 | 
			
		||||
  dom->builtintopic_writer_participant = new_local_orphan_writer (&dom->gv, to_entityid (NN_ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER), dom->builtin_participant_topic, qos, builtintopic_whc_new (DSBT_PARTICIPANT, gh));
 | 
			
		||||
  dom->builtintopic_writer_publications = new_local_orphan_writer (&dom->gv, to_entityid (NN_ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER), dom->builtin_writer_topic, qos, builtintopic_whc_new (DSBT_WRITER, gh));
 | 
			
		||||
  dom->builtintopic_writer_subscriptions = new_local_orphan_writer (&dom->gv, to_entityid (NN_ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER), dom->builtin_reader_topic, qos, builtintopic_whc_new (DSBT_READER, gh));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@
 | 
			
		|||
#include "dds__guardcond.h"
 | 
			
		||||
#include "dds__participant.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_iid.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_thread.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,7 @@
 | 
			
		|||
#include "dds/ddsi/q_config.h"
 | 
			
		||||
#include "dds/ddsi/q_globals.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
#include "dds/ddsi/q_thread.h"
 | 
			
		||||
#include "dds/ddsi/q_bswap.h"
 | 
			
		||||
#include "dds__writer.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +34,7 @@ dds_return_t dds_get_matched_subscriptions (dds_entity_t writer, dds_instance_ha
 | 
			
		|||
    return rc;
 | 
			
		||||
  else
 | 
			
		||||
  {
 | 
			
		||||
    const struct ephash *gh = wr->m_entity.m_domain->gv.guid_hash;
 | 
			
		||||
    const struct entity_index *gh = wr->m_entity.m_domain->gv.entity_index;
 | 
			
		||||
    size_t nrds_act = 0;
 | 
			
		||||
    ddsrt_avl_iter_t it;
 | 
			
		||||
    /* FIXME: this ought not be so tightly coupled to the lower layer */
 | 
			
		||||
| 
						 | 
				
			
			@ -45,7 +45,7 @@ dds_return_t dds_get_matched_subscriptions (dds_entity_t writer, dds_instance_ha
 | 
			
		|||
         m = ddsrt_avl_iter_next (&it))
 | 
			
		||||
    {
 | 
			
		||||
      struct proxy_reader *prd;
 | 
			
		||||
      if ((prd = ephash_lookup_proxy_reader_guid (gh, &m->prd_guid)) != NULL)
 | 
			
		||||
      if ((prd = entidx_lookup_proxy_reader_guid (gh, &m->prd_guid)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        if (nrds_act < nrds)
 | 
			
		||||
          rds[nrds_act] = prd->e.iid;
 | 
			
		||||
| 
						 | 
				
			
			@ -57,7 +57,7 @@ dds_return_t dds_get_matched_subscriptions (dds_entity_t writer, dds_instance_ha
 | 
			
		|||
         m = ddsrt_avl_iter_next (&it))
 | 
			
		||||
    {
 | 
			
		||||
      struct reader *rd;
 | 
			
		||||
      if ((rd = ephash_lookup_reader_guid (gh, &m->rd_guid)) != NULL)
 | 
			
		||||
      if ((rd = entidx_lookup_reader_guid (gh, &m->rd_guid)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        if (nrds_act < nrds)
 | 
			
		||||
          rds[nrds_act] = rd->e.iid;
 | 
			
		||||
| 
						 | 
				
			
			@ -84,7 +84,7 @@ dds_return_t dds_get_matched_publications (dds_entity_t reader, dds_instance_han
 | 
			
		|||
    return rc;
 | 
			
		||||
  else
 | 
			
		||||
  {
 | 
			
		||||
    const struct ephash *gh = rd->m_entity.m_domain->gv.guid_hash;
 | 
			
		||||
    const struct entity_index *gh = rd->m_entity.m_domain->gv.entity_index;
 | 
			
		||||
    size_t nwrs_act = 0;
 | 
			
		||||
    ddsrt_avl_iter_t it;
 | 
			
		||||
    /* FIXME: this ought not be so tightly coupled to the lower layer */
 | 
			
		||||
| 
						 | 
				
			
			@ -95,7 +95,7 @@ dds_return_t dds_get_matched_publications (dds_entity_t reader, dds_instance_han
 | 
			
		|||
         m = ddsrt_avl_iter_next (&it))
 | 
			
		||||
    {
 | 
			
		||||
      struct proxy_writer *pwr;
 | 
			
		||||
      if ((pwr = ephash_lookup_proxy_writer_guid (gh, &m->pwr_guid)) != NULL)
 | 
			
		||||
      if ((pwr = entidx_lookup_proxy_writer_guid (gh, &m->pwr_guid)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        if (nwrs_act < nwrs)
 | 
			
		||||
          wrs[nwrs_act] = pwr->e.iid;
 | 
			
		||||
| 
						 | 
				
			
			@ -107,7 +107,7 @@ dds_return_t dds_get_matched_publications (dds_entity_t reader, dds_instance_han
 | 
			
		|||
         m = ddsrt_avl_iter_next (&it))
 | 
			
		||||
    {
 | 
			
		||||
      struct writer *wr;
 | 
			
		||||
      if ((wr = ephash_lookup_writer_guid (gh, &m->wr_guid)) != NULL)
 | 
			
		||||
      if ((wr = entidx_lookup_writer_guid (gh, &m->wr_guid)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        if (nwrs_act < nwrs)
 | 
			
		||||
          wrs[nwrs_act] = wr->e.iid;
 | 
			
		||||
| 
						 | 
				
			
			@ -149,7 +149,7 @@ dds_builtintopic_endpoint_t *dds_get_matched_subscription_data (dds_entity_t wri
 | 
			
		|||
    return NULL;
 | 
			
		||||
  else
 | 
			
		||||
  {
 | 
			
		||||
    const struct ephash *gh = wr->m_entity.m_domain->gv.guid_hash;
 | 
			
		||||
    const struct entity_index *gh = wr->m_entity.m_domain->gv.entity_index;
 | 
			
		||||
    dds_builtintopic_endpoint_t *ret = NULL;
 | 
			
		||||
    ddsrt_avl_iter_t it;
 | 
			
		||||
    /* FIXME: this ought not be so tightly coupled to the lower layer, and not be so inefficient besides */
 | 
			
		||||
| 
						 | 
				
			
			@ -160,7 +160,7 @@ dds_builtintopic_endpoint_t *dds_get_matched_subscription_data (dds_entity_t wri
 | 
			
		|||
         m = ddsrt_avl_iter_next (&it))
 | 
			
		||||
    {
 | 
			
		||||
      struct proxy_reader *prd;
 | 
			
		||||
      if ((prd = ephash_lookup_proxy_reader_guid (gh, &m->prd_guid)) != NULL)
 | 
			
		||||
      if ((prd = entidx_lookup_proxy_reader_guid (gh, &m->prd_guid)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        if (prd->e.iid == ih)
 | 
			
		||||
          ret = make_builtintopic_endpoint (&prd->e.guid, &prd->c.proxypp->e.guid, prd->c.proxypp->e.iid, prd->c.xqos);
 | 
			
		||||
| 
						 | 
				
			
			@ -171,7 +171,7 @@ dds_builtintopic_endpoint_t *dds_get_matched_subscription_data (dds_entity_t wri
 | 
			
		|||
         m = ddsrt_avl_iter_next (&it))
 | 
			
		||||
    {
 | 
			
		||||
      struct reader *rd;
 | 
			
		||||
      if ((rd = ephash_lookup_reader_guid (gh, &m->rd_guid)) != NULL)
 | 
			
		||||
      if ((rd = entidx_lookup_reader_guid (gh, &m->rd_guid)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        if (rd->e.iid == ih)
 | 
			
		||||
          ret = make_builtintopic_endpoint (&rd->e.guid, &rd->c.pp->e.guid, rd->c.pp->e.iid, rd->xqos);
 | 
			
		||||
| 
						 | 
				
			
			@ -192,7 +192,7 @@ dds_builtintopic_endpoint_t *dds_get_matched_publication_data (dds_entity_t read
 | 
			
		|||
    return NULL;
 | 
			
		||||
  else
 | 
			
		||||
  {
 | 
			
		||||
    const struct ephash *gh = rd->m_entity.m_domain->gv.guid_hash;
 | 
			
		||||
    const struct entity_index *gh = rd->m_entity.m_domain->gv.entity_index;
 | 
			
		||||
    dds_builtintopic_endpoint_t *ret = NULL;
 | 
			
		||||
    ddsrt_avl_iter_t it;
 | 
			
		||||
    /* FIXME: this ought not be so tightly coupled to the lower layer, and not be so inefficient besides */
 | 
			
		||||
| 
						 | 
				
			
			@ -203,7 +203,7 @@ dds_builtintopic_endpoint_t *dds_get_matched_publication_data (dds_entity_t read
 | 
			
		|||
         m = ddsrt_avl_iter_next (&it))
 | 
			
		||||
    {
 | 
			
		||||
      struct proxy_writer *pwr;
 | 
			
		||||
      if ((pwr = ephash_lookup_proxy_writer_guid (gh, &m->pwr_guid)) != NULL)
 | 
			
		||||
      if ((pwr = entidx_lookup_proxy_writer_guid (gh, &m->pwr_guid)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        if (pwr->e.iid == ih)
 | 
			
		||||
          ret = make_builtintopic_endpoint (&pwr->e.guid, &pwr->c.proxypp->e.guid, pwr->c.proxypp->e.iid, pwr->c.xqos);
 | 
			
		||||
| 
						 | 
				
			
			@ -214,7 +214,7 @@ dds_builtintopic_endpoint_t *dds_get_matched_publication_data (dds_entity_t read
 | 
			
		|||
         m = ddsrt_avl_iter_next (&it))
 | 
			
		||||
    {
 | 
			
		||||
      struct writer *wr;
 | 
			
		||||
      if ((wr = ephash_lookup_writer_guid (gh, &m->wr_guid)) != NULL)
 | 
			
		||||
      if ((wr = entidx_lookup_writer_guid (gh, &m->wr_guid)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        if (wr->e.iid == ih)
 | 
			
		||||
          ret = make_builtintopic_endpoint (&wr->e.guid, &wr->c.pp->e.guid, wr->c.pp->e.iid, wr->xqos);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@
 | 
			
		|||
#include "dds/ddsi/q_config.h"
 | 
			
		||||
#include "dds/ddsi/q_plist.h"
 | 
			
		||||
#include "dds/ddsi/q_globals.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
#include "dds/version.h"
 | 
			
		||||
#include "dds__init.h"
 | 
			
		||||
#include "dds__domain.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -56,7 +56,7 @@ static dds_return_t dds_participant_qos_set (dds_entity *e, const dds_qos_t *qos
 | 
			
		|||
  {
 | 
			
		||||
    struct participant *pp;
 | 
			
		||||
    thread_state_awake (lookup_thread_state (), &e->m_domain->gv);
 | 
			
		||||
    if ((pp = ephash_lookup_participant_guid (e->m_domain->gv.guid_hash, &e->m_guid)) != NULL)
 | 
			
		||||
    if ((pp = entidx_lookup_participant_guid (e->m_domain->gv.entity_index, &e->m_guid)) != NULL)
 | 
			
		||||
    {
 | 
			
		||||
      nn_plist_t plist;
 | 
			
		||||
      nn_plist_init_empty (&plist);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@
 | 
			
		|||
#include "dds/ddsi/ddsi_tkmap.h"
 | 
			
		||||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds/ddsi/q_thread.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_globals.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_sertopic.h"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,7 @@
 | 
			
		|||
#include "dds/ddsc/dds_rhc.h"
 | 
			
		||||
#include "dds__entity.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_iid.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_thread.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,7 +28,7 @@
 | 
			
		|||
#include "dds/ddsi/q_globals.h"
 | 
			
		||||
#include "dds__builtin.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_sertopic.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
 | 
			
		||||
DECL_ENTITY_LOCK_UNLOCK (extern inline, dds_reader)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -78,7 +78,7 @@ static dds_return_t dds_reader_qos_set (dds_entity *e, const dds_qos_t *qos, boo
 | 
			
		|||
  {
 | 
			
		||||
    struct reader *rd;
 | 
			
		||||
    thread_state_awake (lookup_thread_state (), &e->m_domain->gv);
 | 
			
		||||
    if ((rd = ephash_lookup_reader_guid (e->m_domain->gv.guid_hash, &e->m_guid)) != NULL)
 | 
			
		||||
    if ((rd = entidx_lookup_reader_guid (e->m_domain->gv.entity_index, &e->m_guid)) != NULL)
 | 
			
		||||
      update_reader_qos (rd, qos);
 | 
			
		||||
    thread_state_asleep (lookup_thread_state ());
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -513,7 +513,7 @@ void dds_reader_ddsi2direct (dds_entity_t entity, ddsi2direct_directread_cb_t cb
 | 
			
		|||
      pwrguid_next.entityid.u = (pwrguid_next.entityid.u & ~(uint32_t)0xff) | NN_ENTITYID_KIND_WRITER_NO_KEY;
 | 
			
		||||
    }
 | 
			
		||||
    ddsrt_mutex_unlock (&rd->e.lock);
 | 
			
		||||
    if ((pwr = ephash_lookup_proxy_writer_guid (dds_entity->m_domain->gv.guid_hash, &pwrguid)) != NULL)
 | 
			
		||||
    if ((pwr = entidx_lookup_proxy_writer_guid (dds_entity->m_domain->gv.entity_index, &pwrguid)) != NULL)
 | 
			
		||||
    {
 | 
			
		||||
      ddsrt_mutex_lock (&pwr->e.lock);
 | 
			
		||||
      pwr->ddsi2direct_cb = cb;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,7 +24,7 @@
 | 
			
		|||
#include "dds__serdata_builtintopic.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_tkmap.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
 | 
			
		||||
static const uint64_t unihashconsts[] = {
 | 
			
		||||
  UINT64_C (16292676669999574021),
 | 
			
		||||
| 
						 | 
				
			
			@ -132,7 +132,7 @@ static struct ddsi_serdata *ddsi_serdata_builtin_from_keyhash (const struct ddsi
 | 
			
		|||
  /* FIXME: not quite elegant to manage the creation of a serdata for a built-in topic via this function, but I also find it quite unelegant to let from_sample read straight from the underlying internal entity, and to_sample convert to the external format ... I could claim the internal entity is the "serialised form", but that forces wrapping it in a fragchain in one way or another, which, though possible, is also a bit lacking in elegance. */
 | 
			
		||||
  const struct ddsi_sertopic_builtintopic *tp = (const struct ddsi_sertopic_builtintopic *)tpcmn;
 | 
			
		||||
  /* keyhash must in host format (which the GUIDs always are internally) */
 | 
			
		||||
  struct entity_common *entity = ephash_lookup_guid_untyped (tp->gv->guid_hash, (const ddsi_guid_t *) keyhash->value);
 | 
			
		||||
  struct entity_common *entity = entidx_lookup_guid_untyped (tp->gv->entity_index, (const ddsi_guid_t *) keyhash->value);
 | 
			
		||||
  struct ddsi_serdata_builtintopic *d = serdata_builtin_new(tp, entity ? SDK_DATA : SDK_KEY);
 | 
			
		||||
  memcpy (&d->key, keyhash->value, sizeof (d->key));
 | 
			
		||||
  if (entity)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,7 @@
 | 
			
		|||
#include "dds__get_status.h"
 | 
			
		||||
#include "dds__qos.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
#include "dds/ddsi/q_thread.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_sertopic.h"
 | 
			
		||||
#include "dds/ddsi/q_ddsi_discovery.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -438,7 +438,7 @@ dds_entity_t dds_create_topic_arbitrary (dds_entity_t participant, struct ddsi_s
 | 
			
		|||
 | 
			
		||||
  /* Publish Topic */
 | 
			
		||||
  thread_state_awake (lookup_thread_state (), &par->m_entity.m_domain->gv);
 | 
			
		||||
  ddsi_pp = ephash_lookup_participant_guid (par->m_entity.m_domain->gv.guid_hash, &par->m_entity.m_guid);
 | 
			
		||||
  ddsi_pp = entidx_lookup_participant_guid (par->m_entity.m_domain->gv.entity_index, &par->m_entity.m_guid);
 | 
			
		||||
  assert (ddsi_pp);
 | 
			
		||||
  if (sedp_plist)
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,7 @@
 | 
			
		|||
#include "dds/ddsi/ddsi_serdata.h"
 | 
			
		||||
#include "dds/ddsi/q_unused.h"
 | 
			
		||||
#include "dds/ddsi/q_config.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_globals.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_tkmap.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -28,7 +28,7 @@
 | 
			
		|||
struct bwhc {
 | 
			
		||||
  struct whc common;
 | 
			
		||||
  enum ddsi_sertopic_builtintopic_type type;
 | 
			
		||||
  const struct ephash *guid_hash;
 | 
			
		||||
  const struct entity_index *entidx;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum bwhc_iter_state {
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +42,7 @@ struct bwhc_iter {
 | 
			
		|||
  struct whc_sample_iter_base c;
 | 
			
		||||
  enum bwhc_iter_state st;
 | 
			
		||||
  bool have_sample;
 | 
			
		||||
  struct ephash_enum it;
 | 
			
		||||
  struct entidx_enum it;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* check that our definition of whc_sample_iter fits in the type that callers allocate */
 | 
			
		||||
| 
						 | 
				
			
			@ -92,11 +92,11 @@ static bool bwhc_sample_iter_borrow_next (struct whc_sample_iter *opaque_it, str
 | 
			
		|||
        case DSBT_READER:      kind = EK_READER; break;
 | 
			
		||||
      }
 | 
			
		||||
      assert (whc->type == DSBT_PARTICIPANT || kind != EK_PARTICIPANT);
 | 
			
		||||
      ephash_enum_init (&it->it, whc->guid_hash, kind);
 | 
			
		||||
      entidx_enum_init (&it->it, whc->entidx, kind);
 | 
			
		||||
      it->st = BIS_LOCAL;
 | 
			
		||||
      /* FALLS THROUGH */
 | 
			
		||||
    case BIS_LOCAL:
 | 
			
		||||
      while ((entity = ephash_enum_next (&it->it)) != NULL)
 | 
			
		||||
      while ((entity = entidx_enum_next (&it->it)) != NULL)
 | 
			
		||||
        if (is_visible (entity))
 | 
			
		||||
          break;
 | 
			
		||||
      if (entity) {
 | 
			
		||||
| 
						 | 
				
			
			@ -104,7 +104,7 @@ static bool bwhc_sample_iter_borrow_next (struct whc_sample_iter *opaque_it, str
 | 
			
		|||
        it->have_sample = true;
 | 
			
		||||
        return true;
 | 
			
		||||
      } else {
 | 
			
		||||
        ephash_enum_fini (&it->it);
 | 
			
		||||
        entidx_enum_fini (&it->it);
 | 
			
		||||
        it->st = BIS_INIT_PROXY;
 | 
			
		||||
      }
 | 
			
		||||
      /* FALLS THROUGH */
 | 
			
		||||
| 
						 | 
				
			
			@ -115,11 +115,11 @@ static bool bwhc_sample_iter_borrow_next (struct whc_sample_iter *opaque_it, str
 | 
			
		|||
        case DSBT_READER:      kind = EK_PROXY_READER; break;
 | 
			
		||||
      }
 | 
			
		||||
      assert (kind != EK_PARTICIPANT);
 | 
			
		||||
      ephash_enum_init (&it->it, whc->guid_hash, kind);
 | 
			
		||||
      entidx_enum_init (&it->it, whc->entidx, kind);
 | 
			
		||||
      it->st = BIS_PROXY;
 | 
			
		||||
      /* FALLS THROUGH */
 | 
			
		||||
    case BIS_PROXY:
 | 
			
		||||
      while ((entity = ephash_enum_next (&it->it)) != NULL)
 | 
			
		||||
      while ((entity = entidx_enum_next (&it->it)) != NULL)
 | 
			
		||||
        if (is_visible (entity))
 | 
			
		||||
          break;
 | 
			
		||||
      if (entity) {
 | 
			
		||||
| 
						 | 
				
			
			@ -127,7 +127,7 @@ static bool bwhc_sample_iter_borrow_next (struct whc_sample_iter *opaque_it, str
 | 
			
		|||
        it->have_sample = true;
 | 
			
		||||
        return true;
 | 
			
		||||
      } else {
 | 
			
		||||
        ephash_enum_fini (&it->it);
 | 
			
		||||
        entidx_enum_fini (&it->it);
 | 
			
		||||
        return false;
 | 
			
		||||
      }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -192,11 +192,11 @@ static const struct whc_ops bwhc_ops = {
 | 
			
		|||
  .free = bwhc_free
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct whc *builtintopic_whc_new (enum ddsi_sertopic_builtintopic_type type, const struct ephash *guid_hash)
 | 
			
		||||
struct whc *builtintopic_whc_new (enum ddsi_sertopic_builtintopic_type type, const struct entity_index *entidx)
 | 
			
		||||
{
 | 
			
		||||
  struct bwhc *whc = ddsrt_malloc (sizeof (*whc));
 | 
			
		||||
  whc->common.ops = &bwhc_ops;
 | 
			
		||||
  whc->type = type;
 | 
			
		||||
  whc->guid_hash = guid_hash;
 | 
			
		||||
  whc->entidx = entidx;
 | 
			
		||||
  return (struct whc *) whc;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,7 +20,7 @@
 | 
			
		|||
#include "dds/ddsi/ddsi_serdata.h"
 | 
			
		||||
#include "dds__stream.h"
 | 
			
		||||
#include "dds/ddsi/q_transmit.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
#include "dds/ddsi/q_config.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_radmin.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -121,7 +121,7 @@ static dds_return_t deliver_locally (struct writer *wr, struct ddsi_serdata *pay
 | 
			
		|||
    ddsrt_avl_iter_t it;
 | 
			
		||||
    struct pwr_rd_match *m;
 | 
			
		||||
    struct ddsi_writer_info wrinfo;
 | 
			
		||||
    const struct ephash *gh = wr->e.gv->guid_hash;
 | 
			
		||||
    const struct entity_index *gh = wr->e.gv->entity_index;
 | 
			
		||||
    dds_duration_t max_block_ms = wr->xqos->reliability.max_blocking_time;
 | 
			
		||||
    ddsrt_mutex_unlock (&wr->rdary.rdary_lock);
 | 
			
		||||
    ddsi_make_writer_info (&wrinfo, &wr->e, wr->xqos);
 | 
			
		||||
| 
						 | 
				
			
			@ -129,7 +129,7 @@ static dds_return_t deliver_locally (struct writer *wr, struct ddsi_serdata *pay
 | 
			
		|||
    for (m = ddsrt_avl_iter_first (&wr_local_readers_treedef, &wr->local_readers, &it); m != NULL; m = ddsrt_avl_iter_next (&it))
 | 
			
		||||
    {
 | 
			
		||||
      struct reader *rd;
 | 
			
		||||
      if ((rd = ephash_lookup_reader_guid (gh, &m->rd_guid)) != NULL)
 | 
			
		||||
      if ((rd = entidx_lookup_reader_guid (gh, &m->rd_guid)) != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        DDS_CTRACE (&wr->e.gv->logconfig, "reader-via-guid "PGUIDFMT"\n", PGUID (rd->e.guid));
 | 
			
		||||
        /* Copied the return value ignore from DDSI deliver_user_data () function. */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,7 +19,7 @@
 | 
			
		|||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_thread.h"
 | 
			
		||||
#include "dds/ddsi/q_xmsg.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
#include "dds__writer.h"
 | 
			
		||||
#include "dds__listener.h"
 | 
			
		||||
#include "dds__init.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -225,7 +225,7 @@ static dds_return_t dds_writer_qos_set (dds_entity *e, const dds_qos_t *qos, boo
 | 
			
		|||
  {
 | 
			
		||||
    struct writer *wr;
 | 
			
		||||
    thread_state_awake (lookup_thread_state (), &e->m_domain->gv);
 | 
			
		||||
    if ((wr = ephash_lookup_writer_guid (e->m_domain->gv.guid_hash, &e->m_guid)) != NULL)
 | 
			
		||||
    if ((wr = entidx_lookup_writer_guid (e->m_domain->gv.entity_index, &e->m_guid)) != NULL)
 | 
			
		||||
      update_writer_qos (wr, qos);
 | 
			
		||||
    thread_state_asleep (lookup_thread_state ());
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,7 +20,7 @@
 | 
			
		|||
#include "dds/version.h"
 | 
			
		||||
#include "dds__entity.h"
 | 
			
		||||
#include "dds/ddsi/q_entity.h"
 | 
			
		||||
#include "dds/ddsi/q_ephash.h"
 | 
			
		||||
#include "dds/ddsi/ddsi_entity_index.h"
 | 
			
		||||
#include "dds/ddsrt/cdtors.h"
 | 
			
		||||
#include "dds/ddsrt/misc.h"
 | 
			
		||||
#include "dds/ddsrt/process.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -98,7 +98,7 @@ static seqno_t get_pmd_seqno(dds_entity_t participant)
 | 
			
		|||
  struct writer *wr;
 | 
			
		||||
  CU_ASSERT_EQUAL_FATAL(dds_entity_pin(participant, &pp_entity), 0);
 | 
			
		||||
  thread_state_awake(lookup_thread_state(), &pp_entity->m_domain->gv);
 | 
			
		||||
  pp = ephash_lookup_participant_guid(pp_entity->m_domain->gv.guid_hash, &pp_entity->m_guid);
 | 
			
		||||
  pp = entidx_lookup_participant_guid(pp_entity->m_domain->gv.entity_index, &pp_entity->m_guid);
 | 
			
		||||
  wr = get_builtin_writer(pp, NN_ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER);
 | 
			
		||||
  CU_ASSERT_FATAL(wr != NULL);
 | 
			
		||||
  assert(wr != NULL); /* for Clang's static analyzer */
 | 
			
		||||
| 
						 | 
				
			
			@ -118,7 +118,7 @@ static dds_duration_t get_pmd_interval(dds_entity_t participant)
 | 
			
		|||
  struct participant *pp;
 | 
			
		||||
  CU_ASSERT_EQUAL_FATAL(dds_entity_pin(participant, &pp_entity), 0);
 | 
			
		||||
  thread_state_awake(lookup_thread_state(), &pp_entity->m_domain->gv);
 | 
			
		||||
  pp = ephash_lookup_participant_guid(pp_entity->m_domain->gv.guid_hash, &pp_entity->m_guid);
 | 
			
		||||
  pp = entidx_lookup_participant_guid(pp_entity->m_domain->gv.entity_index, &pp_entity->m_guid);
 | 
			
		||||
  intv = pp_get_pmd_interval(pp);
 | 
			
		||||
  thread_state_asleep(lookup_thread_state());
 | 
			
		||||
  dds_entity_unpin(pp_entity);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue