LibreOffice Module cli_ure (master) 1
|
represents a polymorphic type. More...
Public Member Functions | |
override object[] | GetCustomAttributes (bool inherit) |
override object[] | GetCustomAttributes (Type attributeType, bool inherit) |
override bool | IsDefined (Type attributeType, bool inherit) |
override ConstructorInfo[] | GetConstructors (BindingFlags bindingAttr) |
override Type | GetElementType () |
override EventInfo | GetEvent (string name, BindingFlags bindingAttr) |
override EventInfo[] | GetEvents (BindingFlags bindingAttr) |
override FieldInfo | GetField (string name, BindingFlags bindingAttr) |
override FieldInfo[] | GetFields (BindingFlags bindingAttr) |
override Type | GetInterface (string name, bool ignoreCase) |
override Type[] | GetInterfaces () |
override MemberInfo[] | GetMembers (BindingFlags bindingAttr) |
override MethodInfo[] | GetMethods (BindingFlags bindingAttr) |
override Type | GetNestedType (string name, BindingFlags bindingAttr) |
override Type[] | GetNestedTypes (BindingFlags bindingAttr) |
override PropertyInfo[] | GetProperties (BindingFlags bindingAttr) |
override object | InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) |
Public Member Functions inherited from uno::Type | |
def | __init__ (self, typeName, typeClass) |
def | __repr__ (self) |
def | __eq__ (self, that) |
def | __ne__ (self, other) |
def | __hash__ (self) |
Static Public Member Functions | |
static PolymorphicType | GetType (Type type, string name) |
provides a unique instance of this class. More... | |
Protected Member Functions | |
override TypeAttributes | GetAttributeFlagsImpl () |
override ConstructorInfo | GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) |
override MethodInfo | GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) |
override PropertyInfo | GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) |
override bool | HasElementTypeImpl () |
override bool | IsArrayImpl () |
override bool | IsByRefImpl () |
override bool | IsCOMObjectImpl () |
override bool | IsPointerImpl () |
override bool | IsPrimitiveImpl () |
Properties | |
string | PolymorphicName [get] |
Type | OriginalType [get] |
override string | Name [get] |
override Assembly | Assembly [get] |
override string | AssemblyQualifiedName [get] |
override Type | BaseType [get] |
override string | FullName [get] |
override Guid | GUID [get] |
override Module | Module [get] |
override string | Namespace [get] |
override RuntimeTypeHandle | TypeHandle [get] |
override Type | UnderlyingSystemType [get] |
override Type | DeclaringType [get] |
Private Member Functions | |
PolymorphicType (Type type, string name) | |
Private Attributes | |
Type | m_base |
string | m_type_name |
Static Private Attributes | |
static Hashtable | m_ht_types = Hashtable.Synchronized(new Hashtable(256)) |
Additional Inherited Members | |
Public Attributes inherited from uno::Type | |
typeName | |
typeClass | |
represents a polymorphic type.
This class is used to carry type information for polymorphic struct types and arrays of polymorphic struct types. These types would be easiest represented with type templates, which are not available in .NET 1.1. Therefore the System.Type cannot contain information about template parameters. To retain this information we use PolymorphicType which directly inherits from System.Type. The additional information about type parameters are passed as simple string when creating an instance of PolymorphicType. Usually one only needs a PolymorphicType when a polymporphic type is put into an uno.Any. For example, let's assume there is a idl type PolyStruct:
module test { struct PolyStruct< T > { T member; }; };
Then one would use it in C# in this way:
uno.Any myAny = new uno.Any( PolymorphicType.GetType( typeof(PolyStruct), "unoidl.test.PolyStruct<System.Boolean>"), new PolyStruct(true));
or if one has a sequence of polymorphic structs:
uno.Any myAny = new uno.Any( PolymorphicType.GetType( typeof(PolyStruct), "unoidl.test.PolyStruct<System.Boolean>[]"), new PolyStruct[] {new PolyStruct(true)} );
To get a new instance of PolymorphicType one uses the static method PolymorphicType.GetType. The method ensures that there is only one instance for each distinct name. For example, if GetType is called multiple times with the name "unoidl.test.PolyStruct<System.Boolean>" then the same instance of PolymorphicType is returned. This makes it possible to compare the instances by reference, thas is using the operator "==".
The polymorphic name, which is passed as second argument to PolymorphicType.GetType, contains a list of type names. Only type names common to all CLI languages can be used. That is, instead of using names, such as char, int, float, the names System.Char, System.Int32 and System.Single are to be used. Spaces are not allowed. The name will always start with "unoidl", when the type was generated by climaker. Here are a couple of possible strings:
unoidl.test.PolyStruct<System.Int32> unoidl.test.PolyStruct<System.Char[]> unoidl.test.PolyStruct<System.Int64>[] unoidl.test.PolyStruct<unoidl.test.PolyStruct<System.Int64>> unoidl.test.PolyStruct<unoidl.test.PolyStruct<System.Int64[]>[]>[]
In the future, when the CLI supports templates, we will probably adapt the cli-uno bridge accordingly to use real template types. Then this class will become obsolete.
Definition at line 84 of file PolymorphicType.cs.
|
inlineprivate |
Definition at line 140 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base, uno.PolymorphicType.m_type_name, name, and type.
Referenced by uno.PolymorphicType.GetType().
|
inlineprotected |
Definition at line 272 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inlineprotected |
Definition at line 277 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inline |
Definition at line 288 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inline |
Definition at line 252 of file PolymorphicType.cs.
References inherit, and uno.PolymorphicType.m_base.
|
inline |
Definition at line 258 of file PolymorphicType.cs.
References inherit, and uno.PolymorphicType.m_base.
|
inline |
Definition at line 294 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inline |
Definition at line 299 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base, and name.
|
inline |
Definition at line 306 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inline |
Definition at line 312 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base, and name.
|
inline |
Definition at line 319 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inline |
Definition at line 325 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base, and name.
|
inline |
Definition at line 331 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inline |
Definition at line 336 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inlineprotected |
Definition at line 342 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base, and name.
|
inline |
Definition at line 354 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inline |
Definition at line 360 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base, and name.
|
inline |
Definition at line 366 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inline |
Definition at line 372 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inlineprotected |
Definition at line 378 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base, and name.
|
inlinestatic |
provides a unique instance of this class.
This function returns null if the specified type is no polymorphic struct.
type | the type of the polymorphic struct. For example, created by typeof(unoidl.com.sun.star.beans.Defaulted) |
name | the full name of the struct (including the type list). |
System.ArgumentNullException | The argument was null. |
Definition at line 106 of file PolymorphicType.cs.
References Attribute, elementType(), lock(), uno.PolymorphicType.m_ht_types, name, uno.PolymorphicType.PolymorphicType(), t, and type.
Referenced by cli_uno.loadCliType().
|
inlineprotected |
Definition at line 390 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inline |
Definition at line 395 of file PolymorphicType.cs.
References args, uno.PolymorphicType.m_base, and name.
|
inlineprotected |
Definition at line 409 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inlineprotected |
Definition at line 414 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inlineprotected |
Definition at line 419 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inline |
Definition at line 265 of file PolymorphicType.cs.
References inherit, and uno.PolymorphicType.IsDefined().
Referenced by uno.PolymorphicType.IsDefined().
|
inlineprotected |
Definition at line 424 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
inlineprotected |
Definition at line 429 of file PolymorphicType.cs.
References uno.PolymorphicType.m_base.
|
private |
Definition at line 86 of file PolymorphicType.cs.
Referenced by uno.PolymorphicType.GetAttributeFlagsImpl(), uno.PolymorphicType.GetConstructorImpl(), uno.PolymorphicType.GetConstructors(), uno.PolymorphicType.GetCustomAttributes(), uno.PolymorphicType.GetElementType(), uno.PolymorphicType.GetEvent(), uno.PolymorphicType.GetEvents(), uno.PolymorphicType.GetField(), uno.PolymorphicType.GetFields(), uno.PolymorphicType.GetInterface(), uno.PolymorphicType.GetInterfaces(), uno.PolymorphicType.GetMembers(), uno.PolymorphicType.GetMethodImpl(), uno.PolymorphicType.GetMethods(), uno.PolymorphicType.GetNestedType(), uno.PolymorphicType.GetNestedTypes(), uno.PolymorphicType.GetProperties(), uno.PolymorphicType.GetPropertyImpl(), uno.PolymorphicType.HasElementTypeImpl(), uno.PolymorphicType.InvokeMember(), uno.PolymorphicType.IsArrayImpl(), uno.PolymorphicType.IsByRefImpl(), uno.PolymorphicType.IsCOMObjectImpl(), uno.PolymorphicType.IsPointerImpl(), uno.PolymorphicType.IsPrimitiveImpl(), and uno.PolymorphicType.PolymorphicType().
Definition at line 89 of file PolymorphicType.cs.
Referenced by uno.PolymorphicType.GetType().
|
private |
Definition at line 87 of file PolymorphicType.cs.
Referenced by uno.PolymorphicType.PolymorphicType().
|
get |
Definition at line 172 of file PolymorphicType.cs.
|
get |
Definition at line 180 of file PolymorphicType.cs.
|
get |
Definition at line 188 of file PolymorphicType.cs.
|
get |
Definition at line 244 of file PolymorphicType.cs.
|
get |
Definition at line 196 of file PolymorphicType.cs.
|
get |
Definition at line 204 of file PolymorphicType.cs.
|
get |
Definition at line 212 of file PolymorphicType.cs.
|
get |
Definition at line 164 of file PolymorphicType.cs.
|
get |
Definition at line 220 of file PolymorphicType.cs.
|
get |
Definition at line 154 of file PolymorphicType.cs.
Referenced by climaker::TypeEmitter.complete_service_type().
|
get |
Definition at line 146 of file PolymorphicType.cs.
Referenced by climaker::TypeEmitter.complete_service_type(), and cli_uno.mapCliType().
|
get |
Definition at line 228 of file PolymorphicType.cs.
|
get |
Definition at line 236 of file PolymorphicType.cs.