GridFlow 0.7.3 - index of this page: | |||
notesObjects for Scripting
Objects for Internals
| |||
notes | |||
In Ruby, GridFlow defines a namespace (module) called GridFlow. Most of the constants it defines are part of that namespace. A GridFlow object is normally in two or three parts: a (Ruby) GridFlow::FObject that is the central part; a (C++) GridObject; a (C++/jMax) BFObject. The GridFlow::FObject is created as a RData kind of box using Ruby-C's Data_Make_Struct on a GridObject. This is how most Ruby-C programs inherit from Ruby classes. Note that Ruby's boxed objects have a maximum of five fields, and they're usually taken, so additional fields have to be outside of it. This is why RData exists. | |||
So basically you have a GridObject that is "part of" a GridFlow::FObject and they point to each other using peer pointers. Now, if jMax is enabled, then the GridObject will have an additional pointer to a fts_object_t derivative called BFObject (B for Bridge); that pointer is called foreign_peer. The BFObject links back to the RData box through another pointer called peer. | |||
Objects for Scripting | |||
class ruby class FObject extending Data | |||
Provides inlets and outlets to Ruby Objects. method init () method send_in (int inlet, message...) method send_out (int outlet, message...) | |||
class ruby class GridObject extending FObject | |||
Provides grid support to FObjects. method inlet_dim (Integer inlet) gives an array of Integers (dimension list) method inlet_nt (Integer inlet) gives a Symbol (number type) method inlet_set_factor (Integer inlet, Integer factor) ensures received packets have a size that is a whole multiple of this size. must be called from rgrid_begin. method send_out_grid_begin (Integer outlet, Array of Integer dimensions, number type nt) establishes grid streams between an outlet and all inlets connected to it. method send_out_grid_flow (Integer outlet, String data) for sending a grid data packet through that outlet. method send_out_grid_end (Integer outlet) (isn't this one obsolete?) inlet 0 method rgrid_begin () inlet 0 method rgrid_flow (String data) inlet 0 method rgrid_end () | |||
class ruby class BitPacking | |||
A BitPacking is a simple two-way converter between different numeric layouts. | |||
class FPatcher extending FObject | |||
This class is much like jMax's templates and subpatchers and PureData's abstractions. This is a container for objects. Its proper objects are numbered starting with zero. The wire list is given in terms of those numbers: (sourceobject,sourceinlet,destobject,destinlet). There is a pseudo-object numbered #-1 which map to the container's own inlets and outlets. | |||
Objects for Internals | |||
class C++ class GridInlet | |||
GridInlets represent inlets that accept grids. | |||
class C++ class GridOutlet | |||
GridOutlets represent outlets that send grids. | |||
class C++ class Dim | |||
Dim represents a list of dimensions. | |||
class C++ class Grid | |||
Grid represents a grid that is fully stored in memory. | |||
class C++ class Operator1 | |||
This represents a one-input operator. Such an object contains a map() function that applies the operator over a memory segment. | |||
class C++ class Operator2 | |||
This represents a two-input operator. Such an object contains four functions for each T, where T is one of the types uint8, int16, int32, float32. method map (integer n, T * as, T b) for i in 0...n, as[i] := f(as[i],b); This is like [@] with a scalar righthand method zip (integer n, T * as, T * bs) for i in 0...n, as[i] := f(as[i],bs[i]); bs is not modified. (This is like [@] with a nonscalar righthand) method fold (integer an, integer n, T * as, T * bs) for i in 0...n, for j in 0...an, as[j] := f(as[j],bs[i*an+j]); (this is like @fold)method scan (integer an, integer n, T * as, T * bs) for j in 0...an: bs[j] := f(as[j],bs[j]); for i in 1...n: for j in 0...an: bs[j] := f(bs[(i-1)*an+j],bs[i*an+j]); (this is like @scan) | |||
class C++ class GridClass | |||
This represents a class of GridObjects. | |||
class C++ class GFBridge | |||
This holds linkage information about jMax and PureData and such. | |||
GridFlow 0.7.3 Documentation |