Chapter 9. DynamicClass

Table of Contents
Introduction
Methods
 

President Merkin Muffley: Gentlemen, you can't fight in here, this is the war room!

 
--Dr. Strangelove 

Introduction

DynamicClass is the abstraction layer of AFC "plugins". A DynamicClass rappresents a dynamically loaded class in memory, that can be used inside your applications, once you have them loaded from disk. Load, instance creation and instance disposion are handled by DynamicClassMaster, so you should have a look at that class to know how to load new "plugins" in memory.

Once you have a DynamicClass instance, you can work with it in several ways. The standard way to execute a DynamicClass method is to call the afc_dynamic_class_execute() call, that will resolve method pointer and will call it. If you want really fast and responsive feedback, you may wish to save the function pointer inside a DynamicClassMethod variable. to do so, simply call afc_dynamic_class_find_method() and you'll be able to call that method by your own.

Advanced users only: Please, keep in mind that this is stuff for advanced users only. There are some things you have to manually set if you want to call a method by your own.

DynamicClass also supports storing of variables. You can set and get variable values by using afc_dynamic_class_set_var() and afc_dynamic_class_get_var() respectively. Variables can be of three kind: