LibreOffice Module cli_ure (master) 1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
uno.PolymorphicType Class Reference

represents a polymorphic type. More...

Inheritance diagram for uno.PolymorphicType:
[legend]
Collaboration diagram for uno.PolymorphicType:
[legend]

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PolymorphicType()

uno.PolymorphicType.PolymorphicType ( Type  type,
string  name 
)
inlineprivate

Member Function Documentation

◆ GetAttributeFlagsImpl()

override TypeAttributes uno.PolymorphicType.GetAttributeFlagsImpl ( )
inlineprotected

Definition at line 272 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetConstructorImpl()

override ConstructorInfo uno.PolymorphicType.GetConstructorImpl ( BindingFlags  bindingAttr,
Binder  binder,
CallingConventions  callConvention,
Type[]  types,
ParameterModifier[]  modifiers 
)
inlineprotected

Definition at line 277 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetConstructors()

override ConstructorInfo[] uno.PolymorphicType.GetConstructors ( BindingFlags  bindingAttr)
inline

Definition at line 288 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetCustomAttributes() [1/2]

override object[] uno.PolymorphicType.GetCustomAttributes ( bool  inherit)
inline

Definition at line 252 of file PolymorphicType.cs.

References inherit, and uno.PolymorphicType.m_base.

◆ GetCustomAttributes() [2/2]

override object[] uno.PolymorphicType.GetCustomAttributes ( Type  attributeType,
bool  inherit 
)
inline

Definition at line 258 of file PolymorphicType.cs.

References inherit, and uno.PolymorphicType.m_base.

◆ GetElementType()

override Type uno.PolymorphicType.GetElementType ( )
inline

Definition at line 294 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetEvent()

override EventInfo uno.PolymorphicType.GetEvent ( string  name,
BindingFlags  bindingAttr 
)
inline

Definition at line 299 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base, and name.

◆ GetEvents()

override EventInfo[] uno.PolymorphicType.GetEvents ( BindingFlags  bindingAttr)
inline

Definition at line 306 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetField()

override FieldInfo uno.PolymorphicType.GetField ( string  name,
BindingFlags  bindingAttr 
)
inline

Definition at line 312 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base, and name.

◆ GetFields()

override FieldInfo[] uno.PolymorphicType.GetFields ( BindingFlags  bindingAttr)
inline

Definition at line 319 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetInterface()

override Type uno.PolymorphicType.GetInterface ( string  name,
bool  ignoreCase 
)
inline

Definition at line 325 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base, and name.

◆ GetInterfaces()

override Type[] uno.PolymorphicType.GetInterfaces ( )
inline

Definition at line 331 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetMembers()

override MemberInfo[] uno.PolymorphicType.GetMembers ( BindingFlags  bindingAttr)
inline

Definition at line 336 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetMethodImpl()

override MethodInfo uno.PolymorphicType.GetMethodImpl ( string  name,
BindingFlags  bindingAttr,
Binder  binder,
CallingConventions  callConvention,
Type[]  types,
ParameterModifier[]  modifiers 
)
inlineprotected

Definition at line 342 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base, and name.

◆ GetMethods()

override MethodInfo[] uno.PolymorphicType.GetMethods ( BindingFlags  bindingAttr)
inline

Definition at line 354 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetNestedType()

override Type uno.PolymorphicType.GetNestedType ( string  name,
BindingFlags  bindingAttr 
)
inline

Definition at line 360 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base, and name.

◆ GetNestedTypes()

override Type[] uno.PolymorphicType.GetNestedTypes ( BindingFlags  bindingAttr)
inline

Definition at line 366 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetProperties()

override PropertyInfo[] uno.PolymorphicType.GetProperties ( BindingFlags  bindingAttr)
inline

Definition at line 372 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ GetPropertyImpl()

override PropertyInfo uno.PolymorphicType.GetPropertyImpl ( string  name,
BindingFlags  bindingAttr,
Binder  binder,
Type  returnType,
Type[]  types,
ParameterModifier[]  modifiers 
)
inlineprotected

Definition at line 378 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base, and name.

◆ GetType()

static PolymorphicType uno.PolymorphicType.GetType ( Type  type,
string  name 
)
inlinestatic

provides a unique instance of this class.

This function returns null if the specified type is no polymorphic struct.

Parameters
typethe type of the polymorphic struct. For example, created by typeof(unoidl.com.sun.star.beans.Defaulted)
namethe full name of the struct (including the type list).
Returns
null - the argument type is no valid polymorphic struct or
an instance of this class.
Exceptions
System.ArgumentNullExceptionThe 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().

◆ HasElementTypeImpl()

override bool uno.PolymorphicType.HasElementTypeImpl ( )
inlineprotected

Definition at line 390 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ InvokeMember()

override object uno.PolymorphicType.InvokeMember ( string  name,
BindingFlags  invokeAttr,
Binder  binder,
object  target,
object[]  args,
ParameterModifier[]  modifiers,
CultureInfo  culture,
string[]  namedParameters 
)
inline

Definition at line 395 of file PolymorphicType.cs.

References args, uno.PolymorphicType.m_base, and name.

◆ IsArrayImpl()

override bool uno.PolymorphicType.IsArrayImpl ( )
inlineprotected

Definition at line 409 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ IsByRefImpl()

override bool uno.PolymorphicType.IsByRefImpl ( )
inlineprotected

Definition at line 414 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ IsCOMObjectImpl()

override bool uno.PolymorphicType.IsCOMObjectImpl ( )
inlineprotected

Definition at line 419 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ IsDefined()

override bool uno.PolymorphicType.IsDefined ( Type  attributeType,
bool  inherit 
)
inline

Definition at line 265 of file PolymorphicType.cs.

References inherit, and uno.PolymorphicType.IsDefined().

Referenced by uno.PolymorphicType.IsDefined().

◆ IsPointerImpl()

override bool uno.PolymorphicType.IsPointerImpl ( )
inlineprotected

Definition at line 424 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

◆ IsPrimitiveImpl()

override bool uno.PolymorphicType.IsPrimitiveImpl ( )
inlineprotected

Definition at line 429 of file PolymorphicType.cs.

References uno.PolymorphicType.m_base.

Member Data Documentation

◆ m_base

Type uno.PolymorphicType.m_base
private

◆ m_ht_types

Hashtable uno.PolymorphicType.m_ht_types = Hashtable.Synchronized(new Hashtable(256))
staticprivate

Definition at line 89 of file PolymorphicType.cs.

Referenced by uno.PolymorphicType.GetType().

◆ m_type_name

string uno.PolymorphicType.m_type_name
private

Definition at line 87 of file PolymorphicType.cs.

Referenced by uno.PolymorphicType.PolymorphicType().

Property Documentation

◆ Assembly

override Assembly uno.PolymorphicType.Assembly
get

Definition at line 172 of file PolymorphicType.cs.

◆ AssemblyQualifiedName

override string uno.PolymorphicType.AssemblyQualifiedName
get

Definition at line 180 of file PolymorphicType.cs.

◆ BaseType

override Type uno.PolymorphicType.BaseType
get

Definition at line 188 of file PolymorphicType.cs.

◆ DeclaringType

override Type uno.PolymorphicType.DeclaringType
get

Definition at line 244 of file PolymorphicType.cs.

◆ FullName

override string uno.PolymorphicType.FullName
get

Definition at line 196 of file PolymorphicType.cs.

◆ GUID

override Guid uno.PolymorphicType.GUID
get

Definition at line 204 of file PolymorphicType.cs.

◆ Module

override Module uno.PolymorphicType.Module
get

Definition at line 212 of file PolymorphicType.cs.

◆ Name

override string uno.PolymorphicType.Name
get

Definition at line 164 of file PolymorphicType.cs.

◆ Namespace

override string uno.PolymorphicType.Namespace
get

Definition at line 220 of file PolymorphicType.cs.

◆ OriginalType

Type uno.PolymorphicType.OriginalType
get

Definition at line 154 of file PolymorphicType.cs.

Referenced by climaker::TypeEmitter.complete_service_type().

◆ PolymorphicName

string uno.PolymorphicType.PolymorphicName
get

◆ TypeHandle

override RuntimeTypeHandle uno.PolymorphicType.TypeHandle
get

Definition at line 228 of file PolymorphicType.cs.

◆ UnderlyingSystemType

override Type uno.PolymorphicType.UnderlyingSystemType
get

Definition at line 236 of file PolymorphicType.cs.


The documentation for this class was generated from the following file: