C# Class RemotingGen.Generator

Inheritance: TextGenerator
Mostrar archivo Open project: FloodProject/flood Class Usage Examples

Public Methods

Method Description
GenerateDataObject ( Type type ) : void
GenerateDataObjectFactory ( ) : void
GenerateDelegateClasses ( ) : void
GenerateService ( Type type ) : void
Generator ( Assembly currentAssembly, GenerationContext generationContext ) : System
GetMethodReturnType ( MethodInfo method ) : Type
IsTask ( Type type ) : bool

Private Methods

Method Description
CheckParametersIds ( MethodInfo method, bool &hasIds ) : bool
ConvertFieldToParametersList ( Type type ) : List
ConvertFromTypeToThrift ( Type type ) : DataType

Converts from regular type to equivalent DataType.

ConvertToActualParameters ( IEnumerable parameters ) : IEnumerable
ConvertToParametersList ( MethodInfo method ) : List
GenerateContainerDoubleElementDeserialization ( Type elemType1, Type elemType2, string containerName, string dataName ) : void

Generates the code to deserialize a double element container

GenerateContainerDoubleElementSerialization ( Type elemType1, Type elemType2, string iterName, string dataName ) : void

Generates the code to serialize a dual element container

GenerateDataObjectClass ( string className, List parameters, string @namespace, bool isValueType, Type dataObjecDataType = null ) : void
GenerateDataObjectOverride ( string name, string className, bool hasBaseType, bool isValueType, System.Action printer ) : void
GenerateDataObjectRead ( string className, bool hasBaseType, bool isValueType, IEnumerable parameters ) : void
GenerateDataObjectWrite ( string className, bool hasBaseType, bool isValueType ) : void
GenerateDataObjectWriteBitField ( IEnumerable parameters, Type baseType ) : void
GenerateDelegateClass ( Type type ) : void
GenerateDelegateProxyInvoke ( MethodInfo methodInvoke, string argsName, string resultName ) : void
GenerateEventSubscribeMethod ( EventInfo @event ) : void
GenerateEventUnsubscribeMethod ( EventInfo @event ) : void
GenerateListDeserialize ( Type type, string name, string dataName ) : void

Generates the code to deserialize a list

GenerateListSerialize ( Type type, string name, string dataName ) : void

Generates the code to serialize a list

GenerateMapDeserialize ( Type type, string name, string dataName ) : void

Generates the code to deserialize a map

GenerateMapSerialize ( Type type, string name, string dataName ) : void

Generates the code to serialize a map

GenerateMethodSerializers ( MethodInfo method, string argsClassName, string resultClassName ) : void
GenerateParameterList ( IList parameters ) : void
GenerateProtocolMethod ( MethodInfo method, int methodId, string methodName, string argsClassName, string resultClassName, string callType, string methodClassName = null ) : void
GenerateProtocolReceive ( MethodInfo method, string methodName, string resultClassName ) : void
GenerateProtocolSend ( MethodInfo method, ParameterInfo parameters, string methodId, string methodName, string argsClassName, string callType ) : void
GenerateProxyEvent ( Type type, EventInfo eventInfo ) : void
GenerateServiceProcessMethod ( MethodInfo method ) : void
GenerateServiceProcessor ( Type type ) : void
GenerateServiceProxy ( Type type ) : void
GenerateTypeDeserialization ( Type type, string varName, string dataName, bool varExists = true ) : void

Generates the code to deserialize a single element of an array

GenerateTypeSerialization ( Type type, string varName, string dataName ) : void

Generates the code to serialize a type

GenerateUsings ( ) : void
GetAllFields ( Type t ) : IEnumerable
GetAllProperties ( Type t ) : IEnumerable
GetBaseDataObjects ( Type type ) : List
GetDelegateImplClassName ( Type type, bool doCreate = true ) : string
GetDelegateName ( Type type, bool doCreate = true ) : string
GetDelegateProxyClassName ( Type type, bool doCreate = true ) : string
GetEventId ( EventInfo @event ) : int
GetEventSubscribeMethodName ( EventInfo @event ) : string
GetEventUnsubscribeMethodName ( EventInfo @event ) : string
GetInheritedService ( Type type, Type &@base ) : bool
GetMessageFlags ( MethodInfo method ) : List
GetProcedureArgsClassName ( MethodInfo method ) : string
GetProcedureCallId ( MethodInfo method ) : int
GetProcedureProcessMethodName ( MethodInfo method ) : string
GetProcedureResultClassName ( MethodInfo method ) : string
GetProperty ( MethodInfo method ) : PropertyInfo

If method is getter or setter of a property returns the PropertyInfo associated

GetStubsClassName ( Type type, bool fullName ) : string
GetTypeCast ( Type type ) : string
GetTypeCastToStub ( Type type ) : string
GetTypeName ( Type type, bool replaceWithStubs = true ) : string
HasArgsSerializer ( MethodInfo method ) : bool
HasResultSerializer ( MethodInfo method ) : bool
IsDelegate ( Type type ) : bool
IsEventMethod ( Type type, MethodInfo method ) : bool
IsInstanceOfGenericType ( Type genericType, Type type ) : bool

Checks if type is a generic type and if it is of the type of genericType or assignable to it

IsInstanceOfGenericType ( Type genericType, object instance ) : bool

Checks if type of instance is a generic type and if it is of the type of genericType or assignable to it

IsNullableType ( Type type ) : bool
ToTitleCase ( string str ) : string

Method Details

GenerateDataObject() public method

public GenerateDataObject ( Type type ) : void
type System.Type
return void

GenerateDataObjectFactory() public method

public GenerateDataObjectFactory ( ) : void
return void

GenerateDelegateClasses() public method

public GenerateDelegateClasses ( ) : void
return void

GenerateService() public method

public GenerateService ( Type type ) : void
type System.Type
return void

Generator() public method

public Generator ( Assembly currentAssembly, GenerationContext generationContext ) : System
currentAssembly System.Reflection.Assembly
generationContext GenerationContext
return System

GetMethodReturnType() public static method

public static GetMethodReturnType ( MethodInfo method ) : Type
method System.Reflection.MethodInfo
return System.Type

IsTask() public static method

public static IsTask ( Type type ) : bool
type System.Type
return bool