HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VEX_VexOp Class Reference

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

#include <VEX_VexOp.h>

Public Member Functions

 ~VEX_VexOp ()
 Standard destructor. More...
 
template<VEX_Precision PREC>
void setCompleted (VEX_VexOpCompleted cback)
 
const UT_StringHoldergetSignature () const
 Query the signature. More...
 
int getContextMask () const
 Query the context mask. More...
 
template<VEX_Precision PREC>
VEX_VexOpInit getInit () const
 Query the initialization function. More...
 
template<VEX_Precision PREC>
VEX_VexOpCallback getEvaluator () const
 Query the evaluation function. More...
 
template<VEX_Precision PREC>
VEX_VexOpTypedCallback getTypedEvaluator () const
 Query the typed evaluation function. More...
 
template<VEX_Precision PREC>
VEX_VexOpCleanup getCleanup () const
 Query the cleanup function. More...
 
template<VEX_Precision PREC>
VEX_VexOpCompleted getCompleted () const
 Query the completed function. More...
 
int getOptimizer () const
 Query the optimization level. More...
 
template<>
void setCompleted (VEX_VexOpCompleted callback)
 
template<>
VEX_VexOpInit getInit () const
 
template<>
VEX_VexOpCallback getEvaluator () const
 
template<>
VEX_VexOpTypedCallback getTypedEvaluator () const
 
template<>
VEX_VexOpCleanup getCleanup () const
 
template<>
VEX_VexOpCleanup getCompleted () const
 
template<>
void setCompleted (VEX_VexOpCompleted callback)
 
template<>
VEX_VexOpInit getInit () const
 
template<>
VEX_VexOpCallback getEvaluator () const
 
template<>
VEX_VexOpTypedCallback getTypedEvaluator () const
 
template<>
VEX_VexOpCleanup getCleanup () const
 
template<>
VEX_VexOpCleanup getCompleted () const
 
 VEX_VexOp (const UT_StringHolder &signature, VEX_VexOpCallback evaluator32, int ctx_mask=(VEX_ALL_CONTEXT), VEX_VexOpInit init32=0, VEX_VexOpCleanup cleanup32=0, int optimize_level=VEX_OPTIMIZE_2, bool force_return_code=false)
 
 VEX_VexOp (const UT_StringHolder &signature, VEX_VexOpCallback evaluator32, VEX_VexOpCallback evaluator64, int ctx_mask=(VEX_ALL_CONTEXT), VEX_VexOpInit init32=0, VEX_VexOpInit init64=0, VEX_VexOpCleanup cleanup32=0, VEX_VexOpCleanup cleanup64=0, int optimize_level=VEX_OPTIMIZE_2, bool force_return_code=false)
 
 VEX_VexOp (const UT_StringHolder &signature, VEX_VexOpTypedCallback evaluator32, int ctx_mask=(VEX_ALL_CONTEXT), VEX_VexOpInit init32=0, VEX_VexOpCleanup cleanup32=0, int optimize_level=VEX_OPTIMIZE_2, bool force_return_code=false)
 
 VEX_VexOp (const UT_StringHolder &signature, VEX_VexOpTypedCallback evaluator32, VEX_VexOpTypedCallback evaluator64, int ctx_mask=(VEX_ALL_CONTEXT), VEX_VexOpInit init32=0, VEX_VexOpInit init64=0, VEX_VexOpCleanup cleanup32=0, VEX_VexOpCleanup cleanup64=0, int optimize_level=VEX_OPTIMIZE_2, bool force_return_code=false)
 

Static Public Member Functions

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

Protected Attributes

UT_StringHolder mySignature
 
VEX_VexOpInit myInit32
 
VEX_VexOpCallback myEvaluator32
 
VEX_VexOpTypedCallback myTypedEvaluator32
 
VEX_VexOpCleanup myCleanup32
 
VEX_VexOpCompleted myCompleted32
 
VEX_VexOpInit myInit64
 
VEX_VexOpCallback myEvaluator64
 
VEX_VexOpTypedCallback myTypedEvaluator64
 
VEX_VexOpCleanup myCleanup64
 
VEX_VexOpCompleted myCompleted64
 
int myContextMask
 
int myOptimizeLevel
 
unsigned int myFlags
 

Detailed Description

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

Examples:
alligator/alligator.C, VEX/VEX_Example.C, VEX/VEX_Ops.C, and VEX/VEX_Sort.C.

Definition at line 144 of file VEX_VexOp.h.

Constructor & Destructor Documentation

VEX_VexOp::VEX_VexOp ( const UT_StringHolder signature,
VEX_VexOpCallback  evaluator32,
int  ctx_mask = (VEX_ALL_CONTEXT),
VEX_VexOpInit  init32 = 0,
VEX_VexOpCleanup  cleanup32 = 0,
int  optimize_level = VEX_OPTIMIZE_2,
bool  force_return_code = false 
)

Function declaration

Parameters
signature
The function name and parameters expected
evaluator32
The evaluation callback (32 bit)
evaluator64
The evaluation callback (64 bit)
ctx_mask
Which contexts this function is available in
init32
Initialization callback (called for every 32 bit instance)
init64
Initialization callback (called for every 64 bit instance)
cleanup32
Cleanup callback (32 bit)
cleanup64
Cleanup callback (64 bit)
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 ( const UT_StringHolder signature,
VEX_VexOpCallback  evaluator32,
VEX_VexOpCallback  evaluator64,
int  ctx_mask = (VEX_ALL_CONTEXT),
VEX_VexOpInit  init32 = 0,
VEX_VexOpInit  init64 = 0,
VEX_VexOpCleanup  cleanup32 = 0,
VEX_VexOpCleanup  cleanup64 = 0,
int  optimize_level = VEX_OPTIMIZE_2,
bool  force_return_code = false 
)

Function declaration

Parameters
signature
The function name and parameters expected
evaluator32
The evaluation callback (32 bit)
evaluator64
The evaluation callback (64 bit)
ctx_mask
Which contexts this function is available in
init32
Initialization callback (called for every 32 bit instance)
init64
Initialization callback (called for every 64 bit instance)
cleanup32
Cleanup callback (32 bit)
cleanup64
Cleanup callback (64 bit)
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 ( const UT_StringHolder signature,
VEX_VexOpTypedCallback  evaluator32,
int  ctx_mask = (VEX_ALL_CONTEXT),
VEX_VexOpInit  init32 = 0,
VEX_VexOpCleanup  cleanup32 = 0,
int  optimize_level = VEX_OPTIMIZE_2,
bool  force_return_code = false 
)

Function declaration

Parameters
signature
The function name and parameters expected
evaluator32
The evaluation callback (32 bit)
evaluator64
The evaluation callback (64 bit)
ctx_mask
Which contexts this function is available in
init32
Initialization callback (called for every 32 bit instance)
init64
Initialization callback (called for every 64 bit instance)
cleanup32
Cleanup callback (32 bit)
cleanup64
Cleanup callback (64 bit)
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 ( const UT_StringHolder signature,
VEX_VexOpTypedCallback  evaluator32,
VEX_VexOpTypedCallback  evaluator64,
int  ctx_mask = (VEX_ALL_CONTEXT),
VEX_VexOpInit  init32 = 0,
VEX_VexOpInit  init64 = 0,
VEX_VexOpCleanup  cleanup32 = 0,
VEX_VexOpCleanup  cleanup64 = 0,
int  optimize_level = VEX_OPTIMIZE_2,
bool  force_return_code = false 
)

Function declaration

Parameters
signature
The function name and parameters expected
evaluator32
The evaluation callback (32 bit)
evaluator64
The evaluation callback (64 bit)
ctx_mask
Which contexts this function is available in
init32
Initialization callback (called for every 32 bit instance)
init64
Initialization callback (called for every 64 bit instance)
cleanup32
Cleanup callback (32 bit)
cleanup64
Cleanup callback (64 bit)
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

template<VEX_Precision PREC>
VEX_VexOpCleanup VEX_VexOp::getCleanup ( ) const

Query the cleanup function.

template<>
VEX_VexOpCleanup VEX_VexOp::getCleanup ( ) const
inline

Definition at line 329 of file VEX_VexOp.h.

template<>
VEX_VexOpCleanup VEX_VexOp::getCleanup ( ) const
inline

Definition at line 348 of file VEX_VexOp.h.

template<VEX_Precision PREC>
VEX_VexOpCompleted VEX_VexOp::getCompleted ( ) const

Query the completed function.

template<>
VEX_VexOpCleanup VEX_VexOp::getCompleted ( ) const
inline

Definition at line 332 of file VEX_VexOp.h.

template<>
VEX_VexOpCleanup VEX_VexOp::getCompleted ( ) const
inline

Definition at line 351 of file VEX_VexOp.h.

int VEX_VexOp::getContextMask ( ) const
inline

Query the context mask.

Definition at line 209 of file VEX_VexOp.h.

static VEX_ErrorLog& VEX_VexOp::getErrorLog ( )
static

During execution of a callback, this method can be used to retrieve the current VEX error log for error reporting. This method will only operate correctly in the thread that executed the callback.

template<VEX_Precision PREC>
VEX_VexOpCallback VEX_VexOp::getEvaluator ( ) const

Query the evaluation function.

template<>
VEX_VexOpCallback VEX_VexOp::getEvaluator ( ) const
inline

Definition at line 323 of file VEX_VexOp.h.

template<>
VEX_VexOpCallback VEX_VexOp::getEvaluator ( ) const
inline

Definition at line 342 of file VEX_VexOp.h.

template<VEX_Precision PREC>
VEX_VexOpInit VEX_VexOp::getInit ( ) const

Query the initialization function.

template<>
VEX_VexOpInit VEX_VexOp::getInit ( ) const
inline

Definition at line 320 of file VEX_VexOp.h.

template<>
VEX_VexOpInit VEX_VexOp::getInit ( ) const
inline

Definition at line 339 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 shared objects loaded.

int VEX_VexOp::getOptimizer ( ) const
inline

Query the optimization level.

Definition at line 226 of file VEX_VexOp.h.

const UT_StringHolder& VEX_VexOp::getSignature ( ) const
inline

Query the signature.

Definition at line 207 of file VEX_VexOp.h.

template<VEX_Precision PREC>
VEX_VexOpTypedCallback VEX_VexOp::getTypedEvaluator ( ) const

Query the typed evaluation function.

template<>
VEX_VexOpTypedCallback VEX_VexOp::getTypedEvaluator ( ) const
inline

Definition at line 326 of file VEX_VexOp.h.

template<>
VEX_VexOpTypedCallback VEX_VexOp::getTypedEvaluator ( ) const
inline

Definition at line 345 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.

template<VEX_Precision PREC>
void VEX_VexOp::setCompleted ( VEX_VexOpCompleted  cback)

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

template<>
void VEX_VexOp::setCompleted ( VEX_VexOpCompleted  callback)
inline

Definition at line 317 of file VEX_VexOp.h.

template<>
void VEX_VexOp::setCompleted ( VEX_VexOpCompleted  callback)
inline

Definition at line 336 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

VEX_VexOpCleanup VEX_VexOp::myCleanup32
protected

Definition at line 279 of file VEX_VexOp.h.

VEX_VexOpCleanup VEX_VexOp::myCleanup64
protected

Definition at line 285 of file VEX_VexOp.h.

VEX_VexOpCompleted VEX_VexOp::myCompleted32
protected

Definition at line 280 of file VEX_VexOp.h.

VEX_VexOpCompleted VEX_VexOp::myCompleted64
protected

Definition at line 286 of file VEX_VexOp.h.

int VEX_VexOp::myContextMask
protected

Definition at line 290 of file VEX_VexOp.h.

VEX_VexOpCallback VEX_VexOp::myEvaluator32
protected

Definition at line 277 of file VEX_VexOp.h.

VEX_VexOpCallback VEX_VexOp::myEvaluator64
protected

Definition at line 283 of file VEX_VexOp.h.

unsigned int VEX_VexOp::myFlags
protected

Definition at line 292 of file VEX_VexOp.h.

VEX_VexOpInit VEX_VexOp::myInit32
protected

Definition at line 276 of file VEX_VexOp.h.

VEX_VexOpInit VEX_VexOp::myInit64
protected

Definition at line 282 of file VEX_VexOp.h.

int VEX_VexOp::myOptimizeLevel
protected

Definition at line 291 of file VEX_VexOp.h.

UT_StringHolder VEX_VexOp::mySignature
protected

Definition at line 273 of file VEX_VexOp.h.

VEX_VexOpTypedCallback VEX_VexOp::myTypedEvaluator32
protected

Definition at line 278 of file VEX_VexOp.h.

VEX_VexOpTypedCallback VEX_VexOp::myTypedEvaluator64
protected

Definition at line 284 of file VEX_VexOp.h.


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