Max 5 API Reference

Class Module
[Jitter]

Collaboration diagram for Class Module:

Functions

void * jit_class_new (char *name, method mnew, method mfree, long size,...)
 Creates a new class with the name specified by the name argument.
t_jit_err jit_class_addmethod (void *c, method m, char *name,...)
 Adds a named method to a class.
t_jit_err jit_class_addattr (void *c, t_jit_object *attr)
 Adds an attribute to a class.
t_jit_err jit_class_addadornment (void *c, t_jit_object *o)
 Adds an adornment to a class.
void * jit_class_adornment_get (void *c, t_symbol *classname)
 Retrieves an adornment from a class.
t_jit_err jit_class_free (void *c)
 Frees a class.
t_symboljit_class_nameget (void *c)
 Retrieves the name of a class.
long jit_class_symcompare (void *c, t_symbol *name)
 Compares name of class with the name provided.
t_jit_err jit_class_register (void *c)
 Registers class in the class registry.
method jit_class_method (void *c, t_symbol *methodname)
 Retrieves method function pointer for named method.
t_messlistjit_class_mess (t_jit_class *c, t_symbol *methodname)
 Retrieves messlist entry for named method.
void * jit_class_attr_get (void *c, t_symbol *attrname)
 Retrieves attribute pointer associated with name provided.
void * jit_class_findbyname (t_symbol *classname)
 Retrieves class pointer associated with name provided.
t_jit_err jit_class_addtypedwrapper (void *c, method m, char *name,...)
 Adds a typed wrapper method to a class.
t_messlistjit_class_typedwrapper_get (void *c, t_symbol *s)
 Retrieves typed wrapper messlist pointer associated with name provided.
t_jit_err jit_class_method_addargsafe (void *c, char *argname, char *methodname)
 Marks a method as safe to call as an attribute style argument.
t_symboljit_class_method_argsafe_get (void *c, t_symbol *s)
 Checks to see if symbol is safe to call as an attribute style argument.

Function Documentation

t_jit_err jit_class_addadornment ( void *  c,
t_jit_object o 
)

Adds an adornment to a class.

Adornments provide additional state and behavior to a class. This is most commonly used for the jit_mop adornment.

Parameters:
c class pointer
o object to use as adornment
Returns:
t_jit_err error code
t_jit_err jit_class_addattr ( void *  c,
t_jit_object attr 
)

Adds an attribute to a class.

Parameters:
c class pointer
attr attribute object
Returns:
t_jit_err error code
t_jit_err jit_class_addmethod ( void *  c,
method  m,
char *  name,
  ... 
)

Adds a named method to a class.

Parameters:
c class pointer
m function called when method is invoked
name method name
... type signature for the method in the standard Max type list format (see Chapter 3 of the Writing Externals in Max document for more information)
Returns:
t_jit_err error code
t_jit_err jit_class_addtypedwrapper ( void *  c,
method  m,
char *  name,
  ... 
)

Adds a typed wrapper method to a class.

Typed wrappers typically are used when there is an existing private, untyped method defined for a Jitter class, but it is desirable to expose the method to language bindings which require a typed interface--e.g. Java or JavaScript.

Parameters:
c class pointer
m function called when method is invoked
name method name
... type signature for the method in the standard Max type list format (see Chapter 3 of the Writing Externals in Max document for more information)
Returns:
t_jit_err error code
void* jit_class_adornment_get ( void *  c,
t_symbol classname 
)

Retrieves an adornment from a class.

Adornments provide additional state and behavior to a class. This is most commonly used for the jit_mop adornment.

Parameters:
c class pointer
classname classname of adornment to retrieve
Returns:
t_jit_err error code
void* jit_class_attr_get ( void *  c,
t_symbol attrname 
)

Retrieves attribute pointer associated with name provided.

Parameters:
c class pointer
attrname attribute name
Returns:
attribute object pointer
void* jit_class_findbyname ( t_symbol classname  ) 

Retrieves class pointer associated with name provided.

Parameters:
classname class name
Returns:
class pointer
t_jit_err jit_class_free ( void *  c  ) 

Frees a class.

Warning:
This function is not typically used outside of jitlib.
Parameters:
c class pointer
Returns:
t_jit_err error code
t_messlist* jit_class_mess ( t_jit_class c,
t_symbol methodname 
)

Retrieves messlist entry for named method.

Parameters:
c class pointer
methodname method name
Returns:
t_messlist pointer.
method jit_class_method ( void *  c,
t_symbol methodname 
)

Retrieves method function pointer for named method.

Parameters:
c class pointer
methodname method name
Returns:
method function pointer.
t_jit_err jit_class_method_addargsafe ( void *  c,
char *  argname,
char *  methodname 
)

Marks a method as safe to call as an attribute style argument.

Warning:
It is important that no argument settable method causes any output into the patcher, or else it could lead to a crash, or other undesired behavior.
Parameters:
c class pointer
argname name as used via argument
methodname name of method to map the argument name to
Returns:
t_jit_err error code
t_symbol* jit_class_method_argsafe_get ( void *  c,
t_symbol s 
)

Checks to see if symbol is safe to call as an attribute style argument.

Parameters:
c class pointer
s name as used via argument
Returns:
If successful, name of method to map the argument name to. Otherwise, NULL.
t_symbol* jit_class_nameget ( void *  c  ) 

Retrieves the name of a class.

Parameters:
c class pointer
Returns:
t_symbol pointer containing name of class
void* jit_class_new ( char *  name,
method  mnew,
method  mfree,
long  size,
  ... 
)

Creates a new class with the name specified by the name argument.

Parameters:
name class name
mnew class constructor
mfree class destructor
size object struct size in bytes
... type signature for the constructor in the standard Max type list format (see Chapter 3 of the Writing Externals in Max document for more information)
Warning:
In order for the Jitter class to be exposed to JavaScript and Java, it is important that the constructor is typed, even if no arguments are provided--i.e. do not use the older strategy of defining Jitter constructors as private and untyped with A_CANT.
Returns:
class pointer to be used in other class functions
t_jit_err jit_class_register ( void *  c  ) 

Registers class in the class registry.

Parameters:
c class pointer
Returns:
t_jit_err error code
long jit_class_symcompare ( void *  c,
t_symbol name 
)

Compares name of class with the name provided.

Parameters:
c class pointer
name name to compare with class name
Returns:
1 if equal, 0 if not equal
t_messlist* jit_class_typedwrapper_get ( void *  c,
t_symbol s 
)

Retrieves typed wrapper messlist pointer associated with name provided.

Parameters:
c class pointer
s name
Returns:
t_messlist pointer

Copyright © 2008, Cycling '74