class Bindgen::Parser::Class

Overview

Describes a C++ class or struct.

Defined in:

bindgen/parser/class.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(__temp_113 : JSON::PullParser) #

def self.new(name : String, byteSize : Int32 = 0, hasDefaultConstructor : Bool = false, hasCopyConstructor : Bool = false, isClass : Bool = true, isAbstract : Bool = false, isDestructible : Bool = true, bases : Array(Bindgen::Parser::BaseClass) = [] of BaseClass, fields : Array(Bindgen::Parser::Field) = [] of Field, methods : Array(Bindgen::Parser::Method) = [] of Method) #

[View source]

Instance Method Detail

def abstract? : Bool #

Is this class abstract?


[View source]
def as_type(pointer = 1, reference = false, const = false) : Type #

Returns a Type referencing this class.


[View source]
def bases : Array(BaseClass) #

def bases=(_bases : Array(BaseClass)) #

def binding_name : String #

The name of the class as part of binding methods.


[View source]
def byte_size : Int32 #

Size of an instance of the class in memory.


[View source]
def byteSize : Int32 #

def byteSize=(_byteSize : Int32) #

def class? : Bool #

Is this a class? Opposite of #struct?.


[View source]
def destructible? : Bool #

Is this class publicly destructible?


[View source]
def destructor_method : Method #

Constructs a method destroying an instance of this class.


[View source]
def destructor_name : String #

The full binding function name of the destructor.


[View source]
def each_wrappable_method(&) #

Yields each wrappable method without any further processing.

Note: This method hard-codes which methods to ignore. If you're wondering why a method doesn't even reach the graph in the first place, look in here.


[View source]
def fields : Array(Field) #

def fields=(_fields : Array(Field)) #

def find_parent_method(method : Method) : Method | Nil #

Assumes that method exists in a class inheriting from this class. Tries to find a method in this class which is overriden by method.


[View source]
def has_copy_constructor? : Bool #

Is the type copy-constructable?


[View source]
def has_default_constructor? : Bool #

Does the type have a default, argument-less constructor?


[View source]
def has_virtual_methods? #

Does this class have any virtual methods?


[View source]
def hasCopyConstructor : Bool #

def hasCopyConstructor=(_hasCopyConstructor : Bool) #

def hasDefaultConstructor : Bool #

def hasDefaultConstructor=(_hasDefaultConstructor : Bool) #

def isAbstract : Bool #

def isAbstract=(_isAbstract : Bool) #

def isClass : Bool #

def isClass=(_isClass : Bool) #

def isDestructible : Bool #

def isDestructible=(_isDestructible : Bool) #

def methods : Array(Method) #

def methods=(_methods : Array(Method)) #

def name : String #

def name=(_name : String) #

def struct? #

Is this a struct? Opposite of #class?.


[View source]
def to_json(json : JSON::Builder) #

def wrap_methods : Array(Method) #

List of all wrappable-methods. This includes all Method#variants. Methods which use Method#move_semantics? on any type are explicitly removed.

Note: This is a memoized getter. Thus it's cheap to call it multiple times.


[View source]
def wrappable_methods #

Non-yielding version of #each_wrappable_method


[View source]