22 using System.Runtime.InteropServices;
24 using DDS.OpenSplice.OS;
25 using DDS.OpenSplice.CustomMarshalers;
26 using DDS.OpenSplice.Common;
71 private IntPtr cmnQpPtr;
72 private cmn_qosProviderInputAttr attr =
new cmn_qosProviderInputAttr();
74 private void loadQosInputAttr(
75 OpenSplice.CustomMarshalers.DatabaseMarshaler qosMarshaler,
77 ref OpenSplice.Common.cmn_qosInputAttr attr)
79 DatabaseMarshaler.Add(null, dataType, qosMarshaler);
80 qosMarshaler.InitEmbeddedMarshalers(null);
82 attr.copyOut = qosMarshaler.CopyOutDelegate;
85 private ReturnCode qpResultToReturnCode (QP_RESULT qpResult)
91 result =
DDS.ReturnCode.Ok;
93 case QP_RESULT.NO_DATA:
94 result =
DDS.ReturnCode.NoData;
96 case QP_RESULT.OUT_OF_MEMORY:
97 result =
DDS.ReturnCode.OutOfResources;
99 case QP_RESULT.ILL_PARAM:
100 result =
DDS.ReturnCode.BadParameter;
103 result =
DDS.ReturnCode.Error;
140 attr =
new cmn_qosProviderInputAttr ();
141 attr.participantQos =
new cmn_qosInputAttr();
142 attr.topicQos =
new cmn_qosInputAttr();
143 attr.publisherQos =
new cmn_qosInputAttr();
144 attr.dataWriterQos =
new cmn_qosInputAttr();
145 attr.subscriberQos =
new cmn_qosInputAttr();
146 attr.dataReaderQos =
new cmn_qosInputAttr();
151 new __NamedDomainParticipantQosMarshaler(),
152 typeof(NamedDomainParticipantQos),
153 ref attr.participantQos);
155 new __NamedTopicQosMarshaler(),
156 typeof(NamedTopicQos),
159 new __NamedPublisherQosMarshaler(),
160 typeof(NamedPublisherQos),
161 ref attr.publisherQos);
163 new __NamedSubscriberQosMarshaler(),
164 typeof(NamedSubscriberQos),
165 ref attr.subscriberQos);
167 new __NamedDataWriterQosMarshaler(),
168 typeof(NamedDataWriterQos),
169 ref attr.dataWriterQos);
171 new __NamedDataReaderQosMarshaler(),
172 typeof(NamedDataReaderQos),
173 ref attr.dataReaderQos);
175 IntPtr attrPtr = os.malloc(
new IntPtr(Marshal.SizeOf(attr)));
176 Marshal.StructureToPtr(attr, attrPtr,
false);
177 cmnQpPtr = OpenSplice.Common.QosProvider.New(uri, profile, attrPtr);
180 if (cmnQpPtr == IntPtr.Zero)
185 throw new System.NullReferenceException(
"cmn_qosProviderNew returned a NULL pointer.");
225 ReportStack.Start ();
226 NamedDomainParticipantQos pQos =
new NamedDomainParticipantQos ();
227 GCHandle qosHandle = GCHandle.Alloc (pQos, GCHandleType.Normal);
229 OpenSplice.Common.QosProvider.GetParticipantQos (cmnQpPtr,
id, GCHandle.ToIntPtr (qosHandle)));
231 participantQos = pQos.DomainparticipantQos;
233 ReportStack.Report (result,
"Could not copy DomainParticipantQos.");
236 ReportStack.Flush(null, result !=
ReturnCode.Ok);
269 ReportStack.Start ();
270 NamedTopicQos tQos =
new NamedTopicQos ();
271 GCHandle qosHandle = GCHandle.Alloc (tQos, GCHandleType.Normal);
273 OpenSplice.Common.QosProvider.GetTopicQos (cmnQpPtr,
id, GCHandle.ToIntPtr (qosHandle)));
275 topicQos = tQos.TopicQos;
277 ReportStack.Report (result,
"Could not copy TopicQos.");
280 ReportStack.Flush(null, result !=
ReturnCode.Ok);
313 ReportStack.Start ();
314 NamedSubscriberQos sQos =
new NamedSubscriberQos ();
315 GCHandle qosHandle = GCHandle.Alloc (sQos, GCHandleType.Normal);
317 OpenSplice.Common.QosProvider.GetSubscriberQos (cmnQpPtr,
id, GCHandle.ToIntPtr (qosHandle)));
319 subscriberQos = sQos.SubscriberQos;
321 ReportStack.Report (result,
"Could not copy subscriberQos.");
324 ReportStack.Flush(null, result !=
ReturnCode.Ok);
357 ReportStack.Start ();
358 NamedDataReaderQos drQos =
new NamedDataReaderQos ();
359 GCHandle qosHandle = GCHandle.Alloc (drQos, GCHandleType.Normal);
361 OpenSplice.Common.QosProvider.GetDataReaderQos (cmnQpPtr,
id, GCHandle.ToIntPtr (qosHandle)));
363 datareaderQos = drQos.DatareaderQos;
365 ReportStack.Report (result,
"Could not copy datareaderQos.");
369 ReportStack.Flush(null, result !=
ReturnCode.Ok);
402 ReportStack.Start ();
403 NamedPublisherQos pQos =
new NamedPublisherQos ();
404 GCHandle qosHandle = GCHandle.Alloc (pQos, GCHandleType.Normal);
406 OpenSplice.Common.QosProvider.GetPublisherQos (cmnQpPtr,
id, GCHandle.ToIntPtr (qosHandle)));
408 publisherQos = pQos.PublisherQos;
410 ReportStack.Report (result,
"Could not copy publisherQos.");
414 ReportStack.Flush(null, result !=
ReturnCode.Ok);
447 ReportStack.Start ();
448 NamedDataWriterQos dwQos =
new NamedDataWriterQos ();
449 GCHandle qosHandle = GCHandle.Alloc (dwQos, GCHandleType.Normal);
451 OpenSplice.Common.QosProvider.GetDataWriterQos (cmnQpPtr,
id, GCHandle.ToIntPtr (qosHandle)));
453 datawriterQos = dwQos.DatawriterQos;
455 ReportStack.Report (result,
"Could not copy datawriterQos.");
459 ReportStack.Flush(null, result !=
ReturnCode.Ok);
QosProvider(string uri, string profile)
Constructs a new QosProvider based on the provided uri and profile.
ReturnCode GetTopicQos(ref TopicQos topicQos, string id)
Resolves the TopicQos identified by the id from the uri this QosProvider is associated with...
ReturnCode GetDataReaderQos(ref DataReaderQos datareaderQos, string id)
Resolves the DataReaderQos identified by the id from the uri this QosProvider is associated with...
ReturnCode GetDataWriterQos(ref DataWriterQos datawriterQos, string id)
Resolves the DataWriterQos identified by the id from the uri this QosProvider is associated with...
This struct provides the basic mechanism for an application to specify Quality of Service attributes ...
This struct provides the basic mechanism for an application to specify Quality of Service attributes ...
This struct provides the basic mechanism for an application to specify Quality of Service attributes ...
ReturnCode
This is the enum that represents the various ReturnCode values that DDS operations return...
ReturnCode GetPublisherQos(ref PublisherQos publisherQos, string id)
Resolves the PublisherQos identified by the id from the uri this QosProvider is associated with...
This struct provides the basic mechanism for an application to specify Quality of Service attributes ...
This class provides the basic mechanism for an application to specify Quality of Service attributes f...
This struct provides the basic mechanism for an application to specify Quality of Service attributes ...
ReturnCode GetSubscriberQos(ref SubscriberQos subscriberQos, string id)
Resolves the SubscriberQos identified by the id from the uri this QosProvider is associated with...
ReturnCode GetParticipantQos(ref DomainParticipantQos participantQos, string id)
Resolves the DomainParticipantQos identified by the id from the uri this QosProvider is associated wi...
Create a QosProvider fetching QoS configuration from the specified URI.