Пример #1
0
        public override void CopyOut(System.IntPtr from, System.IntPtr to)
        {
            __ContinueScale nativeImg     = (__ContinueScale)Marshal.PtrToStructure(from, typeof(__ContinueScale));
            GCHandle        tmpGCHandleTo = GCHandle.FromIntPtr(to);
            ContinueScale   toObj         = tmpGCHandleTo.Target as ContinueScale;

            CopyOut(ref nativeImg, ref toObj);
            tmpGCHandleTo.Target = toObj;
        }
Пример #2
0
        public V_COPYIN_RESULT CopyIn(System.IntPtr typePtr, ContinueScale from, System.IntPtr to)
        {
            __ContinueScale nativeImg = new __ContinueScale();
            V_COPYIN_RESULT result    = CopyIn(typePtr, from, ref nativeImg);

            if (result == V_COPYIN_RESULT.OK)
            {
                Marshal.StructureToPtr(nativeImg, to, false);
            }
            return(result);
        }
Пример #3
0
        public V_COPYIN_RESULT CopyIn(System.IntPtr typePtr, ContinueScale from, ref __ContinueScale to)
        {
            if (from == null)
            {
                return(V_COPYIN_RESULT.INVALID);
            }
            to.bbg_id = from.bbg_id;
            if (from.sensorName == null)
            {
                return(V_COPYIN_RESULT.INVALID);
            }
            // Unbounded string: bounds check not required...
            if (!Write(c.getBase(typePtr), ref to.sensorName, from.sensorName))
            {
                return(V_COPYIN_RESULT.OUT_OF_MEMORY);
            }
            if (from.dateTime == null)
            {
                return(V_COPYIN_RESULT.INVALID);
            }
            // Unbounded string: bounds check not required...
            if (!Write(c.getBase(typePtr), ref to.dateTime, from.dateTime))
            {
                return(V_COPYIN_RESULT.OUT_OF_MEMORY);
            }
            to.check_count = from.check_count;
            to.read_count  = from.read_count;
            to.sample_rate = from.sample_rate;
            if (from.payload == null)
            {
                return(V_COPYIN_RESULT.INVALID);
            }
            int attr6Seq0Length = from.payload.Length;

            // Unbounded sequence: bounds check not required...
            if (attr6Seq0Type == IntPtr.Zero)
            {
                IntPtr memberOwnerType = DDS.OpenSplice.Database.c.resolve(c.getBase(typePtr), fullyScopedName);
                IntPtr specifier       = DDS.OpenSplice.Database.c.metaResolveSpecifier(memberOwnerType, "payload");
                IntPtr specifierType   = DDS.OpenSplice.Database.c.specifierType(specifier);
                attr6Seq0Type = DDS.OpenSplice.Database.c.typeActualType(specifierType);
            }
            to.payload = DDS.OpenSplice.Database.c.newSequence(attr6Seq0Type, attr6Seq0Length);
            if (to.payload == IntPtr.Zero)
            {
                return(V_COPYIN_RESULT.OUT_OF_MEMORY);
            }
            Marshal.Copy(from.payload, 0, to.payload, attr6Seq0Length);
            return(V_COPYIN_RESULT.OK);
        }
Пример #4
0
        public static void CopyOut(ref __ContinueScale from, ref ContinueScale to)
        {
            if (to == null)
            {
                to = new ContinueScale();
            }
            to.bbg_id      = from.bbg_id;
            to.sensorName  = ReadString(from.sensorName);
            to.dateTime    = ReadString(from.dateTime);
            to.check_count = from.check_count;
            to.read_count  = from.read_count;
            to.sample_rate = from.sample_rate;
            IntPtr attr6Seq0Buf    = from.payload;
            int    attr6Seq0Length = DDS.OpenSplice.Database.c.arraySize(attr6Seq0Buf);

            if (to.payload == null || to.payload.Length != attr6Seq0Length)
            {
                to.payload = new double[attr6Seq0Length];
            }
            if (attr6Seq0Length > 0)
            {
                Marshal.Copy(attr6Seq0Buf, to.payload, 0, attr6Seq0Length);
            }
        }
Пример #5
0
        public static void StaticCopyOut(System.IntPtr from, ref ContinueScale to)
        {
            __ContinueScale nativeImg = (__ContinueScale)Marshal.PtrToStructure(from, typeof(__ContinueScale));

            CopyOut(ref nativeImg, ref to);
        }