Inheritance: DerivedType
Esempio n. 1
0
        /// <summary>
        /// Returns a new type which represents a pointer given the existing type.
        /// </summary>
        public static PythonType POINTER(CodeContext/*!*/ context, PythonType type) {
            PythonContext pc = PythonContext.GetContext(context);
            PythonDictionary dict = (PythonDictionary)pc.GetModuleState(_pointerTypeCacheKey);
            object res;
            if (!dict.TryGetValue(type, out res)) {
                string name;
                if (type == null) {
                    name = "c_void_p";
                } else {
                    name = "LP_" + type.Name;
                }

                dict[type] = res = new PointerType(context,
                   name,
                   PythonTuple.MakeTuple(_Pointer),
                   PythonOps.MakeDictFromItems(new object[] { type, "_type_" })
               );
            }

            return res as PythonType;
        }