pub struct DomainParticipantFactory { /* private fields */ }Expand description
Factory singleton.
Implementations§
Source§impl DomainParticipantFactory
impl DomainParticipantFactory
Sourcepub fn instance() -> &'static Self
pub fn instance() -> &'static Self
Returns the process-wide factory singleton (Spec §2.2.2.2.2.1
get_instance).
Sourcepub fn create_participant(
&self,
domain_id: DomainId,
qos: DomainParticipantQos,
) -> Result<DomainParticipant>
pub fn create_participant( &self, domain_id: DomainId, qos: DomainParticipantQos, ) -> Result<DomainParticipant>
Creates a new DomainParticipant for the given domain id.
Starts the DcpsRuntime with the default config — UDP sockets +
SPDP/SEDP threads.
§Errors
DdsError::TransportError if the UDP sockets do not bind.
Sourcepub fn create_participant_with_config(
&self,
domain_id: DomainId,
qos: DomainParticipantQos,
config: RuntimeConfig,
) -> Result<DomainParticipant>
pub fn create_participant_with_config( &self, domain_id: DomainId, qos: DomainParticipantQos, config: RuntimeConfig, ) -> Result<DomainParticipant>
Variant with an explicitly passed RuntimeConfig (e.g. for
tests with short SPDP periods).
§Errors
DdsError::TransportError if the UDP sockets do not bind.
Sourcepub fn create_participant_offline(
&self,
domain_id: DomainId,
qos: DomainParticipantQos,
) -> DomainParticipant
pub fn create_participant_offline( &self, domain_id: DomainId, qos: DomainParticipantQos, ) -> DomainParticipant
Offline variant without a runtime — only for unit tests that don’t want a network. The returned participant can create topics, but no DataWriters/Readers.
Sourcepub fn lookup_participant(
&self,
domain_id: DomainId,
) -> Option<DomainParticipant>
pub fn lookup_participant( &self, domain_id: DomainId, ) -> Option<DomainParticipant>
Spec §2.2.2.2.2.4 lookup_participant(domain_id) — returns a
previously created participant for the same domain id, or None
if none is registered. With several participants for the same
domain, the implementation returns the first.
Sourcepub fn delete_participant(&self, p: &DomainParticipant) -> Result<()>
pub fn delete_participant(&self, p: &DomainParticipant) -> Result<()>
Spec §2.2.2.2.2.3 delete_participant. Removes the participant
from the factory registry and calls delete_contained_entities.
Returns PreconditionNotMet if the participant is not in the
registry.
§Errors
DdsError::PreconditionNotMet if the participant is not
registered.
Sourcepub fn set_default_participant_qos(
&self,
qos: DomainParticipantQos,
) -> Result<()>
pub fn set_default_participant_qos( &self, qos: DomainParticipantQos, ) -> Result<()>
Spec §2.2.2.2.2.5 set_default_participant_qos — default QoS
for participants created from now on.
§Errors
DdsError::PreconditionNotMet on lock poisoning.
Sourcepub fn get_default_participant_qos(&self) -> DomainParticipantQos
pub fn get_default_participant_qos(&self) -> DomainParticipantQos
Spec §2.2.2.2.2.5 get_default_participant_qos.
Sourcepub fn set_qos(&self, qos: DomainParticipantFactoryQos) -> Result<()>
pub fn set_qos(&self, qos: DomainParticipantFactoryQos) -> Result<()>
Spec §2.2.2.2.2.6 set_qos (factory-level QoS).
§Errors
DdsError::PreconditionNotMet on lock poisoning.
Sourcepub fn get_qos(&self) -> DomainParticipantFactoryQos
pub fn get_qos(&self) -> DomainParticipantFactoryQos
Spec §2.2.2.2.2.6 get_qos (factory-level QoS).
Sourcepub fn create(domain_id: DomainId) -> ParticipantBuilder
pub fn create(domain_id: DomainId) -> ParticipantBuilder
Fluent entry point for creating a participant: returns a
ParticipantBuilder that collects QoS, a custom
RuntimeConfig, and (with the security feature) a
SecurityBundle, then
materializes the participant on ParticipantBuilder::build.
This is a convenience facade over
Self::create_participant_with_config — build() resolves to
the same live runtime path. It exists so security wiring reads as
one chain:
use zerodds_dcps::DomainParticipantFactory;
let participant = DomainParticipantFactory::create(0)
.with_security(security_bundle)
.build()?;