Author image Marvin Humphrey
and 1 contributors

NAME

Clownfish::Binding::Core::Class - Generate core C code for a class.

DESCRIPTION

Clownfish::Class is an abstract specification for a class. This module autogenerates the C code with implements that specification.

METHODS

new

    my $class_binding = Clownfish::Binding::Core::Class->new(
        client => $class,
    );

get_prefix get_Prefix get_PREFIX

Forwards to the client's methods of the same name.

file_path

    # /path/to/Foo/Bar.c, if source class is Foo::Bar.
    my $path = $class->file_path( '/path/to', '.c' );

Provide an OS-specific path where a file relating to this class could be found, by joining together the components of the "source class" name.

include_h

    print q|#include "| . $class->include_h . q|"|;

Return a relative path to a C header file, appropriately formatted for a pound-include directive.

vtable_var

Return the name of the global VTable object for this class.

vtable_type

Return the C type specifier for this class's vtable. Each vtable needs to have its own type because each has a variable number of methods at the end of the struct, and it's not possible to initialize a static struct with a flexible array at the end under C89.

vtable_definition

Return C code defining the class's VTable.

struct_definition

Create the definition for the instantiable object struct.

callbacks_var

Return the name of the global Callbacks list for this class.

name_var

The name of the global class name var for this class.

name_var_definition

C code defining the ZombieCharBuf which contains the class name for this class.

to_c_header

Return the .h file which contains autogenerated C code defining the class's interface: all method invocation functions, etc...

to_c

Return the .c file which contains autogenerated C code necessary for the class to function properly.

COPYRIGHT AND LICENSE

Copyright 2008-2010 Marvin Humphrey

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.