Go to the documentation of this file.
9 #ifndef _APIGRDPUTILS_H_
10 #define _APIGRDPUTILS_H_
55 #if !defined(GRDP_RUNTIME_INSTDATADECL)
56 # define GRDP_RUNTIME_INSTDATADECL
108 GRDP_CLKS_LAST = GRDP_CLKS_SIZE-1
187 clock_t clocks[GRDP_CLKS_SIZE];
483 const char value[],
const char access[],
const char desc[],
503 const bool create =
true);
522 const bool create =
true);
541 const bool create =
true);
560 const bool create =
true);
579 const bool create =
true);
616 #define GRDP_RT_IMPORT_CONDITIONS(rti) (rti)->pReadInfo->importConditions
623 #define GRDP_RT_IS_ABORTED(rti) PWP_CAST_BOOL((rti)->opAborted)
628 #define GRDP_RT_ABORT(rti) ((rti)->opAborted = PWP_TRUE)
633 #define GRDP_IS_CLKS_ID(id) \
634 PWP_CAST_BOOL(((id) >= 0) && ((id) <= GRDP_CLKS_LAST))
639 #define GRDP_RT_CLKS_ID(rti, id) (GRDP_IS_CLKS_ID(id)? (rti)->clocks[id]: 0)
645 #define GRDP_RT_CLKS_DIFF(rti, startId, endId) \
646 ((GRDP_IS_CLKS_ID(startId) && GRDP_IS_CLKS_ID(endId)) ? \
647 ((rti)->clocks[endId] - (rti)->clocks[startId]) : 0)
653 #define GRDP_RT_CLKS_POLL(rti, id) \
654 GRDP_RT_CLKS_DIFF(rti, id, GRDP_CLKS_PROGINCR)
660 #define GRDP_RT_CLKS_POLL_STEP(rti) \
661 GRDP_RT_CLKS_POLL(rti, GRDP_CLKS_BEGSTEP)
667 #define GRDP_RT_CLKS_DIFF_STEP(rti) \
668 GRDP_RT_CLKS_DIFF(rti, GRDP_CLKS_BEGSTEP, GRDP_CLKS_ENDSTEP)
674 #define GRDP_RT_CLKS_POLL_TOTAL(rti) \
675 GRDP_RT_CLKS_POLL(rti, GRDP_CLKS_PROGINIT)
681 #define GRDP_RT_CLKS_DIFF_TOTAL(rti) \
682 GRDP_RT_CLKS_DIFF(rti, GRDP_CLKS_PROGINIT, GRDP_CLKS_PROGEND)
688 #define GRDP_CLKS_TO_MSECS(c) ((PWP_INT32)((c) * 1000) / CLOCKS_PER_SEC)
694 #define GRDP_CLKS_TO_SECS(c) ((PWP_INT32)(c) / CLOCKS_PER_SEC)
700 #define GRDP_CLKS_TO_MINS(c) (GRDP_CLKS_TO_SECS(c) / 60)
706 #define GRDP_CLKS_TO_HOURS(c) (GRDP_CLKS_TO_MINS(c) / 60)
713 #define GRDP_CLKS_TO_HMS(c, h, m, s) \
714 (s = GRDP_CLKS_TO_SECS(c)), \
715 (h = s / 3600), (s -= h * 3600), \
722 #define GRDP_CLKS_TO_FSECS(c) ((PWP_FLOAT)(c) / (PWP_FLOAT)CLOCKS_PER_SEC)
void grdpSendDebugMsg(GRDP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a debug text message (PWP_MSGID_DEBUG) to the framework.
GRDP_RTITEM grdpRtItem[]
The runtime array of GRDP_RTITEM items.
PWP_ENUM_VALTYPE
Supported PWP-API getValue() transfer types.
const GRDP_READINFO * pReadInfo
Runtime grid import settings.
The runtime data representing a PWP-API suported by a plugin.
PWP_BOOL grdpAssignInfoValueReal(const char name[], const PWP_REAL value, const bool create=true)
Creates a key/PWP_REAL-value pair that defines a GRDP info attribute.
GRDP_RTITEM * grdpFindFormatByName(const char name[])
Find an item in grdpRtItem[] by it's name.
An opaque handle to a grid model.
void grdpSendInfoMsg(GRDP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an info text message (PWP_MSGID_INFO) to the framework.
PWP_BOOL grdpPublishValueDefinition(const char name[], PWP_ENUM_VALTYPE type, const char value[], const char access[], const char desc[], const char range[])
Creates a collection of key/value pairs that represent a published grid import attribute definition.
PWP_BOOL grdpProgressEnd(GRDP_RTITEM *pRti, const PWP_BOOL ok)
Ends all progress tracking.
Pointwise Grid Model API Specification (PWGM-API)
GRDP_FORMATINFO FormatInfo
The Grid Import Plugin format data.
GRDP_ENUM_CLOCKS
Supported GRDP clock id values.
PWP_BOOL grdpAssignInfoValue(const char name[], const char value[], const bool create=true)
Creates a key/string-value pair that defines a GRDP info attribute.
The data representing a grid importer instance.
void grdpSendWarningMsg(GRDP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send a warning text message (PWP_MSGID_WARNING) to the framework.
Grid import read control information.
Pointwise Grid Import Plugin API (GRDP-API)
GRDP_RTITEM * grdpFindFormatById(PWP_UINT32 id)
Find an item in grdpRtItem[] by it's id.
PWU_UNFDATA unfData
Unformatted file I/O data.
PWP_BOOL grdpAssignInfoValueEnum(const char name[], const char value[], bool create=true)
Creates a key/enum-value pair that defines a GRDP info attribute.
PWP_BOOL grdpAssignInfoValueInt(const char name[], const PWP_INT value, const bool create=true)
Creates a key/PWP_INT-value pair that defines a GRDP info attribute.
PWU_RTITEM * pApiData
Pointer to the associated PWU_RTITEM structure.
PWGM_HGRIDMODEL model
Runtime grid model handle to import.
PWP_BOOL grdpAssignInfoValueUInt(const char name[], const PWP_UINT value, const bool create=true)
Creates a key/PWP_UINT-value pair that defines a GRDP info attribute.
PWP_BOOL grdpProgressBeginStep(GRDP_RTITEM *pRti, PWP_UINT32 total)
Begins a progress tracking step.
PWP_BOOL grdpProgressInit(GRDP_RTITEM *pRti, PWP_UINT32 cnt)
Initializes a progress tracking session.
Customizes the typedef GRDP_RTITEM declaration.
PWP_BOOL grdpAssignInfoValueBool(const char name[], const bool value, const bool create=true)
Creates a key/bool-value pair that defines a GRDP info attribute.
#define GRDP_RUNTIME_INSTDATADECL
Implementation defined runtime instance data macro.
void grdpSendErrorMsg(GRDP_RTITEM *pRti, const char txt[], PWP_UINT32 code)
Send an error text message (PWP_MSGID_ERROR) to the framework.
PWP_BOOL grdpProgressIncr(GRDP_RTITEM *pRti)
Completes a progress tracking sub-step.
Data and functions useful to PWP-API compliant plugins.
Pointwise Plugin API (PWP-API)
PWP_BOOL grdpProgressEndStep(GRDP_RTITEM *pRti)
Completes a progress tracking major step.
PWP_UINT32 grdpFormatCnt
The number of entries in grdpRtItem[] array.
Unformatted file data block.
FILE * fp
Runtime FILE pointer.