本文整理汇总了C#中TypedefDecl类的典型用法代码示例。如果您正苦于以下问题:C# TypedefDecl类的具体用法?C# TypedefDecl怎么用?C# TypedefDecl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypedefDecl类属于命名空间,在下文中一共展示了TypedefDecl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitTypedefDecl
public override bool VisitTypedefDecl(TypedefDecl typedef)
{
Type type = typedef.Type.Desugar();
List<TypedefDecl> typedefDecls;
if (TypeDefsPerType.ContainsKey(type))
typedefDecls = TypeDefsPerType[type];
else
TypeDefsPerType.Add(type, typedefDecls = new List<TypedefDecl>());
if (!typedefDecls.Contains(typedef))
typedefDecls.Add(typedef);
return base.VisitTypedefDecl(typedef);
}
示例2: VisitTypedefDecl
public override bool VisitTypedefDecl(TypedefDecl typedef)
{
TypeMap typeMap;
if (TypeMapDatabase.FindTypeMap(typedef, out typeMap))
{
if (typeMap.IsIgnored)
Ignore();
return false;
}
return base.VisitTypedefDecl(typedef);
}
示例3: VisitTypedefDecl
public override bool VisitTypedefDecl(TypedefDecl typedef)
{
var @class = typedef.Namespace.FindClass(typedef.Name);
// Clang will walk the typedef'd tag decl and the typedef decl,
// so we ignore the class and process just the typedef.
if (@class != null)
typedef.ExplicityIgnored = true;
if (typedef.Type == null)
typedef.ExplicityIgnored = true;
return base.VisitTypedefDecl(typedef);
}
示例4: VisitMethodDecl
public override bool VisitMethodDecl(Method method)
{
if (!base.VisitMethodDecl(method) || !method.IsVirtual || method.Ignore)
return false;
var @params = method.GatherInternalParams(Driver.Options.IsItaniumLikeAbi, true).ToList();
var delegateName = GenerateDelegateSignature(@params, method.ReturnType);
var @delegate = new TypedefDecl
{
Name = delegateName,
QualifiedType = new QualifiedType(
new PointerType(
new QualifiedType(
new FunctionType
{
CallingConvention = method.CallingConvention,
IsDependent = method.IsDependent,
Parameters = @params,
ReturnType = method.ReturnType
}))),
Namespace = namespaceDelegates
};
var delegateString = @delegate.Visit(TypePrinter).Type;
var existingDelegate = GetExistingDelegate(delegateString);
if (existingDelegate != null)
{
Driver.Delegates.Add(method, existingDelegate);
return true;
}
existingDelegate = new DelegateDefinition(Driver.Options.OutputNamespace, delegateString);
Driver.Delegates.Add(method, existingDelegate);
foreach (var library in Driver.Options.Libraries)
libsDelegates[library].Add(delegateString, existingDelegate);
namespaceDelegates.Declarations.Add(@delegate);
return true;
}
示例5: TypedefDecl
internal TypedefDecl(TypedefDecl.Internal* native)
: this(new global::System.IntPtr(native))
{
}
示例6: TypedefDecl
private TypedefDecl(TypedefDecl.Internal native)
: this(__CopyValue(native))
{
__ownsNativeInstance = true;
}
示例7: VisitTypedefDecl
public override bool VisitTypedefDecl(TypedefDecl typedef)
{
if (!base.VisitTypedefDecl(typedef))
return false;
if (typedef.TranslationUnit.IsSystemHeader)
typedef.ExplicitlyIgnore();
return true;
}
示例8: TypedefDecl
private TypedefDecl(TypedefDecl.Internal native)
: this(__CopyValue(native))
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
示例9: __CreateInstance
public static TypedefDecl __CreateInstance(TypedefDecl.Internal native)
{
return new TypedefDecl(native);
}
示例10: TypedefDecl
private TypedefDecl(TypedefDecl.Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
示例11: __CopyValue
private static void* __CopyValue(TypedefDecl.__Internal native)
{
var ret = Marshal.AllocHGlobal(136);
global::CppSharp.Parser.AST.TypedefDecl.__Internal.cctor_1(ret, new global::System.IntPtr(&native));
return ret.ToPointer();
}
示例12: VisitTypedefDecl
public override bool VisitTypedefDecl(TypedefDecl typedef)
{
throw new NotImplementedException();
}
示例13: AddInternalImplementation
private Class AddInternalImplementation(Class @class)
{
var internalImpl = GetInternalImpl(@class);
var abstractMethods = GetRelevantAbstractMethods(@class);
foreach (var abstractMethod in abstractMethods)
{
var method = new Method(abstractMethod) { Namespace = internalImpl };
internalImpl.Methods.Add(method);
var @delegate = new TypedefDecl
{
Name = ASTHelpers.GetDelegateName(abstractMethod),
QualifiedType = abstractMethod.GetFunctionType(),
IgnoreFlags = abstractMethod.IgnoreFlags,
Namespace = internalImpl,
Access = AccessSpecifier.Private
};
internalImpl.Typedefs.Add(@delegate);
}
internalImpl.Layout = new ClassLayout(@class.Layout);
FillVTable(@class, abstractMethods, internalImpl);
foreach (var method in internalImpl.Methods)
{
method.IsPure = false;
method.IsOverride = true;
method.IsSynthetized = true;
}
return internalImpl;
}
示例14: VisitTypedefDecl
public override bool VisitTypedefDecl(TypedefDecl typedef)
{
if (!Targets.HasFlag(RenameTargets.Delegate))
return false;
return base.VisitTypedefDecl(typedef);
}
示例15: VisitTypedefDecl
public override bool VisitTypedefDecl(TypedefDecl typedef)
{
if (!VisitDeclaration(typedef))
return false;
string msg;
if (HasInvalidType(typedef.Type, out msg))
{
typedef.ExplicitlyIgnore();
Log.Debug("Typedef '{0}' was ignored due to {1} type",
typedef.Name, msg);
return false;
}
return true;
}