Max 5 API Reference
00001 /** 00002 @defgroup datatypes Data Types 00003 */ 00004 00005 00006 /** 00007 @defgroup atom Atoms 00008 @ingroup datatypes 00009 */ 00010 00011 00012 00013 00014 /** 00015 @defgroup atombuf Atombufs 00016 @ingroup datatypes 00017 00018 An Atombuf is an alternative to @ref binbuf for temporary storage of atoms. 00019 Its principal advantage is that the internal structure is publicly 00020 available so you can manipulate the atoms in place. 00021 The standard Max text objects (message box, object box, comment) use the Atombuf 00022 structure to store their text (each word of text is stored as a #t_symbol or a number). 00023 */ 00024 00025 00026 /** 00027 @defgroup binbuf Binbufs 00028 @ingroup datatypes 00029 00030 You won’t need to know about the internal structure of a Binbuf, so 00031 you can use the void * type to refer to one. 00032 */ 00033 00034 00035 00036 /** 00037 @defgroup symbol Symbols 00038 @ingroup datatypes 00039 00040 Max maintains a symbol table of all strings 00041 to speed lookup for message passing. If you want to access the bang 00042 symbol for example, you’ll have to use the expression 00043 gensym("bang"). 00044 For example, gensym() may be needed when sending 00045 messages directly to other Max objects such as with object_method() and 00046 outlet_anything(). These functions expect a #t_symbol*, they don’t 00047 gensym() character strings for you. 00048 00049 The #t_symbol data structure also contains a place to store an arbitrary 00050 value. The following example shows how you can use this feature to 00051 use symbols to share values among two different external object 00052 classes. (Objects of the same class can use the code resource’s global 00053 variable space to share data.) The idea is that the s_thing field of a 00054 #t_symbol can be set to some value, and gensym() will return a 00055 reference to the Symbol. Thus, the two classes just have to agree about 00056 the character string to be used. Alternatively, each could be passed a 00057 #t_symbol that will be used to share data. 00058 00059 Storing a value: 00060 00061 @code 00062 t_symbol *s; 00063 s = gensym("some_weird_string"); 00064 s->s_thing = (t_object *)someValue; 00065 @endcode 00066 00067 Retrieving a value: 00068 00069 @code 00070 t_symbol *s; 00071 s = gensym("some_weird_string"); 00072 someValue = s->s_thing; 00073 @endcode 00074 00075 */ 00076
Copyright © 2008, Cycling '74