VEX_VexOp Class Reference

Use this class to extend VEX by adding custom VEX functions. More...

#include <VEX_VexOp.h>

List of all members.

Public Member Functions

 VEX_VexOp (const char *signature, VEX_VexOpCallback evaluator, int ctx_mask=(VEX_ALL_CONTEXT), VEX_VexOpInit init=0, VEX_VexOpCleanup cleanup=0, int optimize_level=VEX_OPTIMIZE_2, bool force_return_code=false)
 ~VEX_VexOp ()
 Standard destructor.
void setCompleted (VEX_VexOpCompleted cback)
const char * getSignature () const
 Query the signature.
int getContextMask () const
 Query the context mask.
VEX_VexOpInit getInit () const
 Query the initialization function.
VEX_VexOpCallback getEvaluator () const
 Query the evaluation function.
VEX_VexOpCleanup getCleanup () const
 Query the cleanup function.
VEX_VexOpCompleted getCompleted () const
 Query the completed function.
int getOptimizer () const
 Query the optimization level.

Static Public Member Functions

static const char * stringAlloc (const char *str)
static void stringFree (const char *str)
 Function to free an allocated string.
static int getNumVexOps ()
static const VEX_VexOpgetVexOp (int idx)
 Query the Nth function.
static const char * getVexOpLocation (int idx)
 Get the path to the DSO associated with the VEX plug-in.

Protected Attributes

char * mySignature
VEX_VexOpInit myInit
VEX_VexOpCallback myEvaluator
VEX_VexOpCleanup myCleanup
VEX_VexOpCompleted myCompleted
int myContextMask
int myOptimizeLevel
unsigned int myFlags


Detailed Description

Use this class to extend VEX by adding custom VEX functions.
Examples:

VEX/VEX_Example.C, VEX/VEX_Ops.C, and VEX/VEX_Sort.C.

Definition at line 135 of file VEX_VexOp.h.


Constructor & Destructor Documentation

VEX_VexOp::VEX_VexOp ( const char *  signature,
VEX_VexOpCallback  evaluator,
int  ctx_mask = (VEX_ALL_CONTEXT),
VEX_VexOpInit  init = 0,
VEX_VexOpCleanup  cleanup = 0,
int  optimize_level = VEX_OPTIMIZE_2,
bool  force_return_code = false 
)

Function declaration

Parameters:
signature 
The function name and parameters expected
evaluator 
The evaluation callback
ctx_mask 
Which contexts this function is available in
init 
Initialization callback (called for every instance)
cleanup 
Cleanup callback
optimize_level 
Optimization level
force_return_code 
For signatures which have multiple write-only variables, this bool forces the first write-only variable to be interpreted as a return code.

VEX_VexOp::~VEX_VexOp (  ) 

Standard destructor.


Member Function Documentation

VEX_VexOpCleanup VEX_VexOp::getCleanup (  )  const [inline]

Query the cleanup function.

Definition at line 173 of file VEX_VexOp.h.

VEX_VexOpCompleted VEX_VexOp::getCompleted (  )  const [inline]

Query the completed function.

Definition at line 175 of file VEX_VexOp.h.

int VEX_VexOp::getContextMask (  )  const [inline]

Query the context mask.

Definition at line 167 of file VEX_VexOp.h.

VEX_VexOpCallback VEX_VexOp::getEvaluator (  )  const [inline]

Query the evaluation function.

Definition at line 171 of file VEX_VexOp.h.

VEX_VexOpInit VEX_VexOp::getInit (  )  const [inline]

Query the initialization function.

Definition at line 169 of file VEX_VexOp.h.

static int VEX_VexOp::getNumVexOps (  )  [static]

These functions can be used to query the number of DSO's loaded by VEX and the locations of the shadered objects loaded.

int VEX_VexOp::getOptimizer (  )  const [inline]

Query the optimization level.

Definition at line 177 of file VEX_VexOp.h.

const char* VEX_VexOp::getSignature (  )  const [inline]

Query the signature.

Definition at line 165 of file VEX_VexOp.h.

static const VEX_VexOp* VEX_VexOp::getVexOp ( int  idx  )  [static]

Query the Nth function.

static const char* VEX_VexOp::getVexOpLocation ( int  idx  )  [static]

Get the path to the DSO associated with the VEX plug-in.

void VEX_VexOp::setCompleted ( VEX_VexOpCompleted  cback  )  [inline]

Set the completed callback, called when all evaluate calls for a given shader invokation are finished.

Definition at line 161 of file VEX_VexOp.h.

static const char* VEX_VexOp::stringAlloc ( const char *  str  )  [static]

When dealing assigning to string arguments, you must "free" the previous string value by calling "stringFree". You must set the resulting string to the return code from "stringAlloc". If you do your own memory management (i.e. calling strdup() or setting strings to constant values), you will most likely crash VEX. For example:

         void
         vexStrCat(int argc, void *argv[], void *)
         {
             // arg[0] = result, arg[1..2] == strings to concat
             char        work_buf[256];
             VEX_VexOp::stringFree((char *)argv[0]);
             strcpy(work_buf, (char *)argv[1]);
             strcat(work_buf, (char *)argv[2]);
             argv[0] = VEX_VexOp::stringAlloc(work_buf);
         }
Examples:
VEX/VEX_Sort.C.

static void VEX_VexOp::stringFree ( const char *  str  )  [static]

Function to free an allocated string.


Member Data Documentation

Definition at line 224 of file VEX_VexOp.h.

Definition at line 225 of file VEX_VexOp.h.

int VEX_VexOp::myContextMask [protected]

Definition at line 229 of file VEX_VexOp.h.

Definition at line 223 of file VEX_VexOp.h.

unsigned int VEX_VexOp::myFlags [protected]

Definition at line 231 of file VEX_VexOp.h.

Definition at line 222 of file VEX_VexOp.h.

int VEX_VexOp::myOptimizeLevel [protected]

Definition at line 230 of file VEX_VexOp.h.

char* VEX_VexOp::mySignature [protected]

Definition at line 219 of file VEX_VexOp.h.


The documentation for this class was generated from the following file:

Generated on Thu Jan 31 00:34:15 2013 for HDK by  doxygen 1.5.9