Pointwise Plugin SDK
Macros
+ Collaboration diagram for Macros:

Macros

#define CAEPU_CLKS_TO_FSECS(c)   ((PWP_FLOAT)(c) / (PWP_FLOAT)CLOCKS_PER_SEC)
 Returns the clock value c as seconds (PWP_FLOAT). More...
 
#define CAEPU_CLKS_TO_HMS(c, h, m, s)
 Returns the clock value c decomposed into hours, minutes, and seconds (PWP_INT32). That is, c == (h * 3600 + m * 60 + s) * CLOCKS_PER_SEC. More...
 
#define CAEPU_CLKS_TO_HOURS(c)   (CAEPU_CLKS_TO_MINS(c) / 60)
 Returns the clock value c as hours (PWP_INT32). Only whole hour values are possible. More...
 
#define CAEPU_CLKS_TO_MINS(c)   (CAEPU_CLKS_TO_SECS(c) / 60)
 Returns the clock value c as minutes (PWP_INT32). Only whole minute values are possible. More...
 
#define CAEPU_CLKS_TO_MSECS(c)   ((PWP_INT32)((c) * 1000) / CLOCKS_PER_SEC)
 Returns the clock value c as milli seconds (PWP_INT32). Only whole ms values are possible. More...
 
#define CAEPU_CLKS_TO_SECS(c)   ((PWP_INT32)(c) / CLOCKS_PER_SEC)
 Returns the clock value c as seconds (PWP_INT32). Only whole second values are possible. More...
 
#define CAEPU_IS_CLKS_ID(id)   PWP_CAST_BOOL(((id) >= 0) && ((id) <= CAEPU_CLKS_LAST))
 Returns PWP_TRUE if id is a valid CAEPU_ENUM_CLOCKS id. More...
 
#define CAEPU_RT_ABORT(rti)   ((rti)->opAborted = PWP_TRUE)
 Used by plugin to mark the export operation as aborted. More...
 
#define CAEPU_RT_CLKS_DIFF(rti, startId, endId)
 Returns the clock time difference between startId and endId as clocks[endId] - clocks[startId]. The ids are validated. More...
 
#define CAEPU_RT_CLKS_DIFF_STEP(rti)   CAEPU_RT_CLKS_DIFF(rti, CAEPU_CLKS_BEGSTEP, CAEPU_CLKS_ENDSTEP)
 Returns the current clock time difference between CAEPU_CLKS_BEGSTEP and CAEPU_CLKS_ENDSTEP. More...
 
#define CAEPU_RT_CLKS_DIFF_TOTAL(rti)   CAEPU_RT_CLKS_DIFF(rti, CAEPU_CLKS_PROGINIT, CAEPU_CLKS_PROGEND)
 Returns the current clock time difference between CAEPU_CLKS_PROGINIT and CAEPU_CLKS_PROGEND. More...
 
#define CAEPU_RT_CLKS_ID(rti, id)   (CAEPU_IS_CLKS_ID(id)? (rti)->clocks[id]: 0)
 Returns the clock time value for the given id. The id is validated. More...
 
#define CAEPU_RT_CLKS_POLL(rti, id)   CAEPU_RT_CLKS_DIFF(rti, id, CAEPU_CLKS_PROGINCR)
 Returns the current clock time difference between id and CAEPU_CLKS_PROGINCR. More...
 
#define CAEPU_RT_CLKS_POLL_STEP(rti)   CAEPU_RT_CLKS_POLL(rti, CAEPU_CLKS_BEGSTEP)
 Returns the current clock time difference between CAEPU_CLKS_BEGSTEP and CAEPU_CLKS_PROGINCR. More...
 
#define CAEPU_RT_CLKS_POLL_TOTAL(rti)   CAEPU_RT_CLKS_POLL(rti, CAEPU_CLKS_PROGINIT)
 Returns the current clock time difference between CAEPU_CLKS_PROGINIT and CAEPU_CLKS_PROGINCR. More...
 
#define CAEPU_RT_DIM(rti)   (rti)->pWriteInfo->dimension
 Get the export dimension from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_DIM_2D(rti)   CAEPU_RT_DIM_IS(rti, PWP_DIMENSION_2D)
 Returns PWP_TRUE if export dimension is PWP_DIMENSION_2D. More...
 
#define CAEPU_RT_DIM_3D(rti)   CAEPU_RT_DIM_IS(rti, PWP_DIMENSION_3D)
 Returns PWP_TRUE if export dimension is PWP_DIMENSION_3D. More...
 
#define CAEPU_RT_DIM_IS(rti, d)   PWP_CAST_BOOL((d) == CAEPU_RT_DIM(rti))
 Returns PWP_TRUE if export dimension is d. More...
 
#define CAEPU_RT_DIM_TEXT(rti)   caeuDimensionToText((rti)->pWriteInfo->dimension)
 Get the export dimension text from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_ENC_ASCII(rti)   CAEPU_RT_ENC_IS(rti, PWP_ENCODING_ASCII)
 Returns PWP_TRUE if export encoding is PWP_ENCODING_ASCII. More...
 
#define CAEPU_RT_ENC_BINARY(rti)   CAEPU_RT_ENC_IS(rti, PWP_ENCODING_BINARY)
 Returns PWP_TRUE if export encoding is PWP_ENCODING_BINARY. More...
 
#define CAEPU_RT_ENC_IS(rti, e)   PWP_CAST_BOOL((e) == CAEPU_RT_ENCODING(rti))
 Returns PWP_TRUE if export encoding is enc. More...
 
#define CAEPU_RT_ENC_UNFORMATTED(rti)   CAEPU_RT_ENC_IS(rti, PWP_ENCODING_UNFORMATTED)
 Returns PWP_TRUE if export encoding is PWP_ENCODING_UNFORMATTED. More...
 
#define CAEPU_RT_ENCODING(rti)   (rti)->pWriteInfo->encoding
 Get the export encoding from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_ENCODING_TEXT(rti)   caeuEncodeToText((rti)->pWriteInfo->encoding)
 Get the export precision text from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_IS_ABORTED(rti)   PWP_CAST_BOOL((rti)->opAborted)
 Returns PWP_TRUE if the export has been aborted by the user or the plugin itself. More...
 
#define CAEPU_RT_PREC(rti)   (rti)->pWriteInfo->precision
 Get the export precision from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_PREC_DOUBLE(rti)   CAEPU_RT_PREC_IS(rti, PWP_PRECISION_DOUBLE)
 Returns PWP_TRUE if export dimension is PWP_PRECISION_DOUBLE. More...
 
#define CAEPU_RT_PREC_IS(rti, prec)   PWP_CAST_BOOL((prec) == CAEPU_RT_PREC(rti))
 Returns PWP_TRUE if export precision is prec. More...
 
#define CAEPU_RT_PREC_SINGLE(rti)   CAEPU_RT_PREC_IS(rti, PWP_PRECISION_SINGLE)
 Returns PWP_TRUE if export precision is PWP_PRECISION_SINGLE. More...
 
#define CAEPU_RT_PREC_TEXT(rti)   caeuPrecisionToText((rti)->pWriteInfo->precision)
 Get the export precision text from CAEP_RTITEM data pointed to by rti. More...
 
#define CAEPU_RT_TRY(rti, theOp)
 Attempt theOp and abort the export if needed. Returns PWP_FALSE if the export operation is marked as aborted. More...
 

Detailed Description

Macros that work with various CAEP data types.

Macro Definition Documentation

◆ CAEPU_CLKS_TO_FSECS

#define CAEPU_CLKS_TO_FSECS (   c)    ((PWP_FLOAT)(c) / (PWP_FLOAT)CLOCKS_PER_SEC)

Returns the clock value c as seconds (PWP_FLOAT).

Definition at line 985 of file apiCAEPUtils.h.

◆ CAEPU_CLKS_TO_HMS

#define CAEPU_CLKS_TO_HMS (   c,
  h,
  m,
 
)
Value:
(s = CAEPU_CLKS_TO_SECS(c)), \
(h = s / 3600), (s -= h * 3600), \
(m = s / 60), \
(s -= m * 60)
#define CAEPU_CLKS_TO_SECS(c)
Returns the clock value c as seconds (PWP_INT32). Only whole second values are possible.
Definition: apiCAEPUtils.h:957

Returns the clock value c decomposed into hours, minutes, and seconds (PWP_INT32). That is, c == (h * 3600 + m * 60 + s) * CLOCKS_PER_SEC.

Definition at line 976 of file apiCAEPUtils.h.

Referenced by sendDiffTimeMsg().

◆ CAEPU_CLKS_TO_HOURS

#define CAEPU_CLKS_TO_HOURS (   c)    (CAEPU_CLKS_TO_MINS(c) / 60)

Returns the clock value c as hours (PWP_INT32). Only whole hour values are possible.

Definition at line 969 of file apiCAEPUtils.h.

◆ CAEPU_CLKS_TO_MINS

#define CAEPU_CLKS_TO_MINS (   c)    (CAEPU_CLKS_TO_SECS(c) / 60)

Returns the clock value c as minutes (PWP_INT32). Only whole minute values are possible.

Definition at line 963 of file apiCAEPUtils.h.

◆ CAEPU_CLKS_TO_MSECS

#define CAEPU_CLKS_TO_MSECS (   c)    ((PWP_INT32)((c) * 1000) / CLOCKS_PER_SEC)

Returns the clock value c as milli seconds (PWP_INT32). Only whole ms values are possible.

Definition at line 951 of file apiCAEPUtils.h.

Referenced by sendDiffTimeMsg().

◆ CAEPU_CLKS_TO_SECS

#define CAEPU_CLKS_TO_SECS (   c)    ((PWP_INT32)(c) / CLOCKS_PER_SEC)

Returns the clock value c as seconds (PWP_INT32). Only whole second values are possible.

Definition at line 957 of file apiCAEPUtils.h.

◆ CAEPU_IS_CLKS_ID

#define CAEPU_IS_CLKS_ID (   id)    PWP_CAST_BOOL(((id) >= 0) && ((id) <= CAEPU_CLKS_LAST))

Returns PWP_TRUE if id is a valid CAEPU_ENUM_CLOCKS id.

Definition at line 896 of file apiCAEPUtils.h.

◆ CAEPU_RT_ABORT

#define CAEPU_RT_ABORT (   rti)    ((rti)->opAborted = PWP_TRUE)

Used by plugin to mark the export operation as aborted.

Definition at line 846 of file apiCAEPUtils.h.

◆ CAEPU_RT_CLKS_DIFF

#define CAEPU_RT_CLKS_DIFF (   rti,
  startId,
  endId 
)
Value:
((CAEPU_IS_CLKS_ID(startId) && CAEPU_IS_CLKS_ID(endId)) ? \
((rti)->clocks[endId] - (rti)->clocks[startId]) : 0)
#define CAEPU_IS_CLKS_ID(id)
Returns PWP_TRUE if id is a valid CAEPU_ENUM_CLOCKS id.
Definition: apiCAEPUtils.h:896

Returns the clock time difference between startId and endId as clocks[endId] - clocks[startId]. The ids are validated.

Definition at line 908 of file apiCAEPUtils.h.

Referenced by caeuProgressIncr(), and sendClkDiffTimeMsg().

◆ CAEPU_RT_CLKS_DIFF_STEP

#define CAEPU_RT_CLKS_DIFF_STEP (   rti)    CAEPU_RT_CLKS_DIFF(rti, CAEPU_CLKS_BEGSTEP, CAEPU_CLKS_ENDSTEP)

Returns the current clock time difference between CAEPU_CLKS_BEGSTEP and CAEPU_CLKS_ENDSTEP.

Definition at line 930 of file apiCAEPUtils.h.

◆ CAEPU_RT_CLKS_DIFF_TOTAL

#define CAEPU_RT_CLKS_DIFF_TOTAL (   rti)    CAEPU_RT_CLKS_DIFF(rti, CAEPU_CLKS_PROGINIT, CAEPU_CLKS_PROGEND)

Returns the current clock time difference between CAEPU_CLKS_PROGINIT and CAEPU_CLKS_PROGEND.

Definition at line 944 of file apiCAEPUtils.h.

◆ CAEPU_RT_CLKS_ID

#define CAEPU_RT_CLKS_ID (   rti,
  id 
)    (CAEPU_IS_CLKS_ID(id)? (rti)->clocks[id]: 0)

Returns the clock time value for the given id. The id is validated.

Definition at line 902 of file apiCAEPUtils.h.

◆ CAEPU_RT_CLKS_POLL

#define CAEPU_RT_CLKS_POLL (   rti,
  id 
)    CAEPU_RT_CLKS_DIFF(rti, id, CAEPU_CLKS_PROGINCR)

Returns the current clock time difference between id and CAEPU_CLKS_PROGINCR.

Definition at line 916 of file apiCAEPUtils.h.

◆ CAEPU_RT_CLKS_POLL_STEP

#define CAEPU_RT_CLKS_POLL_STEP (   rti)    CAEPU_RT_CLKS_POLL(rti, CAEPU_CLKS_BEGSTEP)

Returns the current clock time difference between CAEPU_CLKS_BEGSTEP and CAEPU_CLKS_PROGINCR.

Definition at line 923 of file apiCAEPUtils.h.

◆ CAEPU_RT_CLKS_POLL_TOTAL

#define CAEPU_RT_CLKS_POLL_TOTAL (   rti)    CAEPU_RT_CLKS_POLL(rti, CAEPU_CLKS_PROGINIT)

Returns the current clock time difference between CAEPU_CLKS_PROGINIT and CAEPU_CLKS_PROGINCR.

Definition at line 937 of file apiCAEPUtils.h.

◆ CAEPU_RT_DIM

#define CAEPU_RT_DIM (   rti)    (rti)->pWriteInfo->dimension

Get the export dimension from CAEP_RTITEM data pointed to by rti.

Definition at line 750 of file apiCAEPUtils.h.

◆ CAEPU_RT_DIM_2D

#define CAEPU_RT_DIM_2D (   rti)    CAEPU_RT_DIM_IS(rti, PWP_DIMENSION_2D)

Returns PWP_TRUE if export dimension is PWP_DIMENSION_2D.

Definition at line 772 of file apiCAEPUtils.h.

◆ CAEPU_RT_DIM_3D

#define CAEPU_RT_DIM_3D (   rti)    CAEPU_RT_DIM_IS(rti, PWP_DIMENSION_3D)

Returns PWP_TRUE if export dimension is PWP_DIMENSION_3D.

Definition at line 767 of file apiCAEPUtils.h.

◆ CAEPU_RT_DIM_IS

#define CAEPU_RT_DIM_IS (   rti,
 
)    PWP_CAST_BOOL((d) == CAEPU_RT_DIM(rti))

Returns PWP_TRUE if export dimension is d.

Definition at line 762 of file apiCAEPUtils.h.

◆ CAEPU_RT_DIM_TEXT

#define CAEPU_RT_DIM_TEXT (   rti)    caeuDimensionToText((rti)->pWriteInfo->dimension)

Get the export dimension text from CAEP_RTITEM data pointed to by rti.

Definition at line 756 of file apiCAEPUtils.h.

Referenced by CaePlugin< MT >::dimensionStr().

◆ CAEPU_RT_ENC_ASCII

#define CAEPU_RT_ENC_ASCII (   rti)    CAEPU_RT_ENC_IS(rti, PWP_ENCODING_ASCII)

Returns PWP_TRUE if export encoding is PWP_ENCODING_ASCII.

Definition at line 823 of file apiCAEPUtils.h.

◆ CAEPU_RT_ENC_BINARY

#define CAEPU_RT_ENC_BINARY (   rti)    CAEPU_RT_ENC_IS(rti, PWP_ENCODING_BINARY)

Returns PWP_TRUE if export encoding is PWP_ENCODING_BINARY.

Definition at line 828 of file apiCAEPUtils.h.

◆ CAEPU_RT_ENC_IS

#define CAEPU_RT_ENC_IS (   rti,
 
)    PWP_CAST_BOOL((e) == CAEPU_RT_ENCODING(rti))

Returns PWP_TRUE if export encoding is enc.

Definition at line 818 of file apiCAEPUtils.h.

◆ CAEPU_RT_ENC_UNFORMATTED

#define CAEPU_RT_ENC_UNFORMATTED (   rti)    CAEPU_RT_ENC_IS(rti, PWP_ENCODING_UNFORMATTED)

Returns PWP_TRUE if export encoding is PWP_ENCODING_UNFORMATTED.

Definition at line 833 of file apiCAEPUtils.h.

◆ CAEPU_RT_ENCODING

#define CAEPU_RT_ENCODING (   rti)    (rti)->pWriteInfo->encoding

Get the export encoding from CAEP_RTITEM data pointed to by rti.

Definition at line 806 of file apiCAEPUtils.h.

◆ CAEPU_RT_ENCODING_TEXT

#define CAEPU_RT_ENCODING_TEXT (   rti)    caeuEncodeToText((rti)->pWriteInfo->encoding)

Get the export precision text from CAEP_RTITEM data pointed to by rti.

Definition at line 812 of file apiCAEPUtils.h.

Referenced by CaePlugin< MT >::encodingStr().

◆ CAEPU_RT_IS_ABORTED

#define CAEPU_RT_IS_ABORTED (   rti)    PWP_CAST_BOOL((rti)->opAborted)

Returns PWP_TRUE if the export has been aborted by the user or the plugin itself.

Definition at line 841 of file apiCAEPUtils.h.

◆ CAEPU_RT_PREC

#define CAEPU_RT_PREC (   rti)    (rti)->pWriteInfo->precision

Get the export precision from CAEP_RTITEM data pointed to by rti.

Definition at line 778 of file apiCAEPUtils.h.

◆ CAEPU_RT_PREC_DOUBLE

#define CAEPU_RT_PREC_DOUBLE (   rti)    CAEPU_RT_PREC_IS(rti, PWP_PRECISION_DOUBLE)

Returns PWP_TRUE if export dimension is PWP_PRECISION_DOUBLE.

Definition at line 800 of file apiCAEPUtils.h.

◆ CAEPU_RT_PREC_IS

#define CAEPU_RT_PREC_IS (   rti,
  prec 
)    PWP_CAST_BOOL((prec) == CAEPU_RT_PREC(rti))

Returns PWP_TRUE if export precision is prec.

Definition at line 790 of file apiCAEPUtils.h.

◆ CAEPU_RT_PREC_SINGLE

#define CAEPU_RT_PREC_SINGLE (   rti)    CAEPU_RT_PREC_IS(rti, PWP_PRECISION_SINGLE)

Returns PWP_TRUE if export precision is PWP_PRECISION_SINGLE.

Definition at line 795 of file apiCAEPUtils.h.

◆ CAEPU_RT_PREC_TEXT

#define CAEPU_RT_PREC_TEXT (   rti)    caeuPrecisionToText((rti)->pWriteInfo->precision)

Get the export precision text from CAEP_RTITEM data pointed to by rti.

Definition at line 784 of file apiCAEPUtils.h.

Referenced by CaePlugin< MT >::precisionStr().

◆ CAEPU_RT_TRY

#define CAEPU_RT_TRY (   rti,
  theOp 
)
Value:
((rti)->opAborted ? PWP_FALSE : \
(((rti)->opAborted = !(theOp)), !CAEPU_RT_IS_ABORTED(rti)))
#define CAEPU_RT_IS_ABORTED(rti)
Returns PWP_TRUE if the export has been aborted by the user or the plugin itself. ...
Definition: apiCAEPUtils.h:841
#define PWP_FALSE
PWP_BOOL logical "false" value.
Definition: apiPWP.h:224

Attempt theOp and abort the export if needed. Returns PWP_FALSE if the export operation is marked as aborted.

The export operation is marked as aborted if and only if theOp returns 0.

Though theOp can be any "boolean" expression, it is typically a function call.

Note
If theOp is a function call, it will only be called if the export has not already been marked as aborted.
Sample usage:
// assume:
// int someFunc(int n);
// returns 0 on failure
caeuProgressBeginStep(pRti, 44); // 44 substeps
if (CAEPU_RT_TRY(pRti, someFunc(1))) {
// someFunc(1) succeeded (returned a non-zero value)
...snip...
}
caeuProgressBeginStep(pRti, 55); // 55 substeps
// The call to someFunc(2) will NOT be made if someFunc(1) failed or if
// CAEPU_RT_IS_ABORTED(pRti) is already true for some other reason.
if (CAEPU_RT_TRY(pRti, someFunc(2))) {
// someFunc(2) succeeded (returned a non-zero value)
...snip...
}

Definition at line 888 of file apiCAEPUtils.h.