Promote domains and Cyclone library to entities

This commit adds two entity types: a "domain", which is the parent of
participants and which is instantiated for each domain that has at least
one participant in it; and "cyclonedds", which is a representation of
the (initialized) Cyclone DDS library in the process and that is the
parent of all domain entities.  The handle of the latter is a
compile-constant, DDS_CYCLONEDDS_HANDLE.

This changes the return value from dds_get_parent when executed on a
participant: it now returns the handle of the entity representing the
domain the participant is attached to.  Two participants in the same
domain self-evidently return the same domain entity.

This allows deleting all participants in a domain by calling dds_delete
on the domain entity, or tearing down everything and deinitializing the
library by calling dds_delete on the top-level entity.

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-08-28 14:15:28 +02:00 committed by eboasson
parent c6befb48a7
commit 0b12ff5cfc
23 changed files with 690 additions and 305 deletions

View file

@ -290,9 +290,12 @@ CU_Test(ddsc_entity, get_entities, .init = create_entity, .fini = delete_entity)
par = dds_get_parent (0);
CU_ASSERT_EQUAL_FATAL(par, DDS_RETCODE_BAD_PARAMETER);
/* Get Parent, a participant doesn't have a parent. */
/* Get Parent, a participant always has a parent (the domain). */
par = dds_get_parent (entity);
CU_ASSERT_EQUAL_FATAL(par, DDS_ENTITY_NIL);
CU_ASSERT_NOT_EQUAL_FATAL(par, DDS_HANDLE_NIL);
/* The domain has a parent: the pseudo-entity for the library */
par = dds_get_parent (par);
CU_ASSERT_EQUAL_FATAL(par, DDS_CYCLONEDDS_HANDLE);
/* ---------- Get Participant ------------ */