Пример #1
0
        public ReturnCode GetRequestedIncompatibleQosStatus(
            ref RequestedIncompatibleQosStatus status)
        {
            ReturnCode result;

            ReportStack.Start();
            if (this.rlReq_isAlive)
            {
                if (status == null)
                {
                    status = new RequestedIncompatibleQosStatus();
                }
                GCHandle statusGCHandle = GCHandle.Alloc(status, GCHandleType.Normal);
                result = uResultToReturnCode(
                    User.Reader.GetIncompatibleQosStatus(
                        rlReq_UserPeer, 1, RequestedIncompatibleQosStatusMarshaler.CopyOut, GCHandle.ToIntPtr(statusGCHandle)));
                status = statusGCHandle.Target as RequestedIncompatibleQosStatus;
                statusGCHandle.Free();
            }
            else
            {
                result = DDS.ReturnCode.AlreadyDeleted;
            }
            ReportStack.Flush(this, result != ReturnCode.Ok);
            return(result);
        }
Пример #2
0
        public ReturnCode GetRequestedIncompatibleQosStatus(
            ref RequestedIncompatibleQosStatus status)
        {
            ReturnCode result;

            using (RequestedIncompatibleQosStatusMarshaler marshaler =
                       new RequestedIncompatibleQosStatusMarshaler())
            {
                if (status == null)
                {
                    status = new RequestedIncompatibleQosStatus();
                }
                if (status.Policies == null)
                {
                    status.Policies = new QosPolicyCount[28];
                }
                marshaler.CopyIn(status);

                result = Gapi.DataReader.get_requested_incompatible_qos_status(
                    GapiPeer, marshaler.GapiPtr);

                if (result == ReturnCode.Ok)
                {
                    marshaler.CopyOut(ref status);
                }
            }

            return(result);
        }
        internal static V_RESULT CopyOut(ref v_incompatibleQosInfo from, RequestedIncompatibleQosStatus to)
        {
            to.TotalCount       = from.totalCount;
            to.TotalCountChange = from.totalChanged;
            to.LastPolicyId     = (QosPolicyId)from.lastPolicyId;
            if (from.totalCount > 0)
            {
                int arrSize = 0;
                for (int i = 0; i < Constants.V_POLICY_ID_COUNT; i++)
                {
                    int v = from.policyCount[i];
                    if (v != 0)
                    {
                        arrSize++;
                    }
                }

                int n = 0;
                to.Policies = new QosPolicyCount[arrSize];
                for (int i = 0; i < Constants.V_POLICY_ID_COUNT; i++)
                {
                    int v = from.policyCount[i];

                    if (v != 0)
                    {
                        to.Policies[n]          = new QosPolicyCount();
                        to.Policies[n].PolicyId = (QosPolicyId)i;
                        to.Policies[n].Count    = v;
                        n++;
                    }
                }
            }
            return(V_RESULT.OK);
        }
 private static void OnRequestedIncompatibleQos(
     AnyDataReader _,
     RequestedIncompatibleQosStatus status)
 {
     // Exercise #3.1 add a message to print when this DataReader discovers an
     // incompatible DataWriter
 }
 private static void OnRequestedIncompatibleQos(
     AnyDataReader _,
     RequestedIncompatibleQosStatus status)
 {
     // Print when this DataReader discovers an incompatible DataWriter
     Console.WriteLine(
         $"Requested incompatible policy: {status.LastPolicy.Name}");
 }
Пример #6
0
        internal static V_RESULT CopyOut(IntPtr fromPtr, IntPtr toPtr)
        {
            v_incompatibleQosInfo from = (v_incompatibleQosInfo)Marshal.PtrToStructure(fromPtr, type);

            GCHandle toGCHandle = GCHandle.FromIntPtr(toPtr);
            RequestedIncompatibleQosStatus to = toGCHandle.Target as RequestedIncompatibleQosStatus;

            V_RESULT result = CopyOut(ref from, to);

            toGCHandle.Target = to;
            return(result);
        }
Пример #7
0
 private void PrivateRequestedIncompatibleQos(
     IntPtr entityData,
     IntPtr enityPtr,
     IntPtr gapi_status)
 {
     if (listener != null)
     {
         IDataReader dataReader = (IDataReader)OpenSplice.SacsSuperClass.fromUserData(enityPtr);
         RequestedIncompatibleQosStatus status = new RequestedIncompatibleQosStatus();
         RequestedIncompatibleQosStatusMarshaler.CopyOut(gapi_status, ref status, 0);
         listener.OnRequestedIncompatibleQos(dataReader, status);
     }
 }
 private void PrivateRequestedIncompatibleQos(
         IntPtr entityData, 
         IntPtr enityPtr, 
         IntPtr gapi_status)
 {
     if (listener != null)
     {
         IDataReader dataReader = (IDataReader)OpenSplice.SacsSuperClass.fromUserData(enityPtr);
         RequestedIncompatibleQosStatus status = new RequestedIncompatibleQosStatus();
         RequestedIncompatibleQosStatusMarshaler.CopyOut(gapi_status, ref status, 0);
         listener.OnRequestedIncompatibleQos(dataReader, status);
     }
 }
Пример #9
0
 public void OnRequestedIncompatibleQos(
     IDataReader the_reader,
     RequestedIncompatibleQosStatus status)
 {
 }
 public void OnRequestedIncompatibleQos(IDataReader entityInterface, RequestedIncompatibleQosStatus status)
 {
 }
Пример #11
0
 public override void OnRequestedIncompatibleQos(DataReader reader, RequestedIncompatibleQosStatus status)
 {
     Console.WriteLine(nameof(OnRequestedIncompatibleQos));
 }
Пример #12
0
 public void OnRequestedIncompatibleQos(IDataReader entityInterface, RequestedIncompatibleQosStatus status)
 {
     Console.WriteLine("=== [ListenerDataListener::OnRequestedIncompatibleQos] : triggered");
 }
Пример #13
0
 public override void OnRequestedIncompatibleQos(DataReader reader, RequestedIncompatibleQosStatus status)
 {
     RequestedIncompatibleQos?.Invoke(reader, status);
 }