internal static int countErrors(DurabilityServiceQosPolicy o)
        {
            int errorCount = 0;

            errorCount += countErrors(o.ServiceCleanupDelay);
            if (o.HistoryKind > HistoryQosPolicyKind.KeepAllHistoryQos)
            {
                errorCount++;
            }
            if (o.HistoryDepth <= 0)
            {
                errorCount++;
            }
            if (o.MaxSamples < 0 && o.MaxSamples != Length.Unlimited)
            {
                errorCount++;
            }
            if (o.MaxInstances < 0 && o.MaxInstances != Length.Unlimited)
            {
                errorCount++;
            }
            if (o.MaxSamplesPerInstance < 0 && o.MaxSamplesPerInstance != Length.Unlimited)
            {
                errorCount++;
            }
            return(errorCount);
        }
 internal static void CopyOut(v_durabilityServicePolicyI_s from, ref DurabilityServiceQosPolicy to)
 {
     if (to == null)
     {
         to = new DurabilityServiceQosPolicy();
     }
     DurationMarshaler.CopyOut(from.v.service_cleanup_delay, ref to.ServiceCleanupDelay);
     to.HistoryKind           = (HistoryQosPolicyKind)from.v.history_kind;
     to.HistoryDepth          = from.v.history_depth;
     to.MaxSamples            = from.v.max_samples;
     to.MaxInstances          = from.v.max_instances;
     to.MaxSamplesPerInstance = from.v.max_samples_per_instance;
 }
 internal static DDS.ReturnCode CopyIn(DurabilityServiceQosPolicy from, ref v_durabilityServicePolicyI_s to)
 {
     DDS.ReturnCode result = DDS.ReturnCode.Ok;
     if (from != null)
     {
         to.v.history_kind             = (V_HISTORYQOSKIND)from.HistoryKind;
         to.v.history_depth            = from.HistoryDepth;
         to.v.max_samples              = from.MaxSamples;
         to.v.max_instances            = from.MaxInstances;
         to.v.max_samples_per_instance = from.MaxSamplesPerInstance;
         result = DurationMarshaler.CopyIn(from.ServiceCleanupDelay, ref to.v.service_cleanup_delay);
     }
     else
     {
         result = DDS.ReturnCode.BadParameter;
         ReportStack.Report(result, "DurabilityServiceQosPolicy attribute may not be a null pointer.");
     }
     return(result);
 }
 public ModifiableDurabilityServiceQosPolicy CopyFrom(DurabilityServiceQosPolicy other)
 {
     return new ModifiableDurabilityServiceQosPolicyImpl(other);
 }
 public ModifiableDurabilityServiceQosPolicyImpl(DurabilityServiceQosPolicy qos)
     : base(qos.GetHistoryKind(),qos.GetServiceCleanupDelay(), qos.GetHistoryDepth(),
     qos.GetMaxSamples(),qos.GetMaxInstances(),qos.GetMaxSamplesPerInstance(),qos.GetBootstrap())
 {
 }
        internal static void CopyOut(IntPtr from, ref DurabilityServiceQosPolicy to, int offset)
        {
        	if (to == null) to = new DurabilityServiceQosPolicy();

            to.ServiceCleanupDelay = BaseMarshaler.ReadDuration(from, offset + offset_service_cleanup_delay);

            to.HistoryKind = (HistoryQosPolicyKind)
                BaseMarshaler.ReadInt32(from, offset + offset_history_kind);

            to.HistoryDepth = BaseMarshaler.ReadInt32(from, offset + offset_history_depth);

            to.MaxSamples = BaseMarshaler.ReadInt32(from, offset + offset_max_samples);

            to.MaxInstances = BaseMarshaler.ReadInt32(from, offset + offset_max_instances);

            to.MaxSamplesPerInstance = BaseMarshaler.ReadInt32(from, offset + offset_max_samples_per_instance);
        }
 internal void CopyOut(ref DurabilityServiceQosPolicy to)
 {
     CopyOut(GapiPtr, ref to, 0);
 }
 internal static DDS.ReturnCode CopyIn(DurabilityServiceQosPolicy from, IntPtr to, int offset)
 {
     DDS.ReturnCode result = DDS.ReturnCode.Ok;
     if (from != null) {
         BaseMarshaler.Write(to, offset + offset_service_cleanup_delay, from.ServiceCleanupDelay);
         BaseMarshaler.Write(to, offset + offset_history_kind, (int)from.HistoryKind);
         BaseMarshaler.Write(to, offset + offset_history_depth, from.HistoryDepth);
         BaseMarshaler.Write(to, offset + offset_max_samples, from.MaxSamples);
         BaseMarshaler.Write(to, offset + offset_max_instances, from.MaxInstances);
         BaseMarshaler.Write(to, offset + offset_max_samples_per_instance, from.MaxSamplesPerInstance);
     } else {
         result = DDS.ReturnCode.BadParameter;
         DDS.OpenSplice.OS.Report(
                 DDS.OpenSplice.ReportType.OS_ERROR,
                 "DDS.OpenSplice.CustomMarshalers.DurabilityServiceQosPolicyMarshaler.CopyIn",
                 "DDS/OpenSplice/CustomMarshalers/QosContainedMarshalers.cs",
                 DDS.ErrorCode.InvalidValue,
                 "DurabilityServiceQosPolicy attribute may not be a null pointer.");
     }
     return result; 
 }
 internal DDS.ReturnCode CopyIn(DurabilityServiceQosPolicy from)
 {
     cleanupRequired = true;
     return CopyIn(from, GapiPtr, 0);
 }