Class Module
+ Collaboration diagram for Class Module:

Functions

t_max_err class_copy (t_symbol *src_name_space, t_symbol *src_classname, t_symbol *dst_name_space, t_symbol *dst_classname)
 Duplicates a previously registered object class, and registers a copy of this 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.
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.
t_jit_err jit_class_addinterface (void *c, void *interfaceclass, long byteoffset, long flags)
 Adds an interface 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_max_err class_copy ( t_symbol src_name_space,
t_symbol src_classname,
t_symbol dst_name_space,
t_symbol dst_classname 
)

Duplicates a previously registered object class, and registers a copy of this class.

Parameters:
src_name_spaceThe source class's name space.
src_classnameThe source class's class name.
dst_name_spaceThe copied class's name space.
dst_classnameThe copied class's class name.
Returns:
This function returns the error code MAX_ERR_NONE if successful, or one of the other error codes defined in "ext_obex.h" if unsuccessful.
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:
cclass pointer
oobject 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:
cclass pointer
attrattribute object
Returns:
t_jit_err error code
t_jit_err jit_class_addinterface ( void *  c,
void *  interfaceclass,
long  byteoffset,
long  flags 
)

Adds an interface to a class.

Automatically expose methods and attributes of an interface class to a classes. Can also be used for class containers or subclassing behavior. If method or attribute is present in interface class prior to this call, the inteface class' method or attribute will not be added. Use a nonzero byteoffset to contained class' object pointer in struct for container class. Use byte offset of zero for interface or subclassing behavior.

Parameters:
cclass pointer
interfaceclassinterface class pointer
byteoffsetbyte offset (if for a contained object)
flagsreserved for future use
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:
cclass pointer
mfunction called when method is invoked
namemethod 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:
cclass pointer
mfunction called when method is invoked
namemethod 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:
cclass pointer
classnameclassname 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:
cclass pointer
attrnameattribute name
Returns:
attribute object pointer
void* jit_class_findbyname ( t_symbol classname)

Retrieves class pointer associated with name provided.

Parameters:
classnameclass 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:
cclass 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:
cclass pointer
methodnamemethod name
Returns:
t_messlist pointer.
method jit_class_method ( void *  c,
t_symbol methodname 
)

Retrieves method function pointer for named method.

Parameters:
cclass pointer
methodnamemethod 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:
cclass pointer
argnamename as used via argument
methodnamename 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:
cclass pointer
sname 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:
cclass 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:
nameclass name
mnewclass constructor
mfreeclass destructor
sizeobject 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:
cclass 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:
cclass pointer
namename 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:
cclass pointer
sname
Returns:
t_messlist pointer