Esempio n. 1
0
        internal static int LoadObjectVector(HObjectVector outVector, IntPtr vectorHandle)
        {
            int dimension;

            EngineAPI.HCkE(EngineAPI.GetObjectVectorDimension(vectorHandle, out dimension));
            int length;

            EngineAPI.HCkE(EngineAPI.GetObjectVectorLength(vectorHandle, out length));
            if (dimension == 1)
            {
                for (int index = length - 1; index >= 0; --index)
                {
                    IntPtr key;
                    EngineAPI.HCkE(EngineAPI.GetObjectVectorObject(vectorHandle, index, out key));
                    outVector[index].O = new HObject(key, false);
                }
            }
            else
            {
                for (int index = length - 1; index >= 0; --index)
                {
                    IntPtr sub_vector_handle;
                    EngineAPI.HCkE(EngineAPI.GetObjectVectorVector(vectorHandle, index, out sub_vector_handle));
                    EngineAPI.HCkE(EngineAPI.LoadObjectVector(outVector[index], sub_vector_handle));
                    EngineAPI.HCkE(EngineAPI.DestroyObjectVector(sub_vector_handle));
                }
            }
            return(2);
        }
Esempio n. 2
0
        internal static HObjectVector GetAndDestroyObjectVector(IntPtr vectorHandle)
        {
            int dimension;

            EngineAPI.HCkE(EngineAPI.GetObjectVectorDimension(vectorHandle, out dimension));
            HObjectVector outVector = new HObjectVector(dimension);

            EngineAPI.HCkE(EngineAPI.LoadObjectVector(outVector, vectorHandle));
            EngineAPI.HCkE(EngineAPI.DestroyObjectVector(vectorHandle));
            return(outVector);
        }