Pointwise Plugin SDK
CaePluginImpl.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CaePlugin class
4  *
5  * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
6  *
7  ***************************************************************************/
8 
9 #include "CaePlugin.h"
10 
11 
12 //***************************************************************************
13 //***************************************************************************
14 //***************************************************************************
15 
16 template< typename MT >
18  const CAEP_WRITEINFO *pWriteInfo) :
19  rti_(*pRti),
20  model_(model),
21  writeInfo_(*pWriteInfo),
22  progMajorSteps_(1)
23 {
25 }
26 
27 template< typename MT >
29 {
30 }
31 
32 template< typename MT >
35 {
36  PWP_BOOL ret = PWP_TRUE;
37  if (!this->beginExport()) {
38  ret = PWP_FALSE;
39  }
40  else if (aborted()) {
41  ret = PWP_FALSE;
42  }
43  else if (!caeuProgressInit(&rti_, progMajorSteps_)) {
44  ret = PWP_FALSE;
45  }
46  else if (aborted()) {
47  ret = PWP_FALSE;
48  }
49  else if (!this->write()) {
50  ret = PWP_FALSE;
51  }
52  else if (aborted()) {
53  ret = PWP_FALSE;
54  }
55  // ALWAYS call endExport()!
56  if (!this->endExport()) {
57  ret = PWP_FALSE;
58  }
59  caeuProgressEnd(&rti_, ret);
60  return ret;
61 }
62 
63 // private ctor
64 template< typename MT >
66  rti_(src.rti_),
67  model_(src.model_),
68  writeInfo_(src.writeInfo_),
69  progMajorSteps_(src.progMajorSteps_)
70 {
71 }
72 
73 // private assignment
74 template< typename MT >
77 {
78 }
CaePlugin
Definition: CaePlugin.h:28
CaePlugin::CaePlugin
CaePlugin(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL model, const CAEP_WRITEINFO *pWriteInfo)
Template constructor.
Definition: CaePluginImpl.h:17
CAEP_RTITEM
The data representing a CAE exporter instance.
Definition: apiCAEPUtils.h:124
CaePlugin.h
PWGM_HGRIDMODEL
An opaque handle to a grid model.
Definition: apiGridModel.h:326
CaePlugin::operator=
CaePlugin & operator=(const CaePlugin &rhs)
Private assignment operator.
Definition: CaePluginImpl.h:76
CaePlugin::~CaePlugin
virtual ~CaePlugin()
Destructor.
Definition: CaePluginImpl.h:28
caeuProgressInit
PWP_BOOL caeuProgressInit(CAEP_RTITEM *pRti, PWP_UINT32 cnt)
Initializes a progress tracking session.
Definition: apiCAEPUtils.cxx:53
PWP_FALSE
#define PWP_FALSE
PWP_BOOL logical "false" value.
Definition: apiPWP.h:306
PWP_BOOL
int PWP_BOOL
logical value
Definition: apiPWP.h:303
CAEP_WRITEINFO
CAE export write control information.
Definition: apiCAEP.h:184
PWP_TRUE
#define PWP_TRUE
PWP_BOOL logical "true" value.
Definition: apiPWP.h:309
CaePlugin::wrapRuntimeFile
void wrapRuntimeFile()
Pass ownership of the runtime FILE pointer to a PwpFile object.
Definition: CaePlugin.h:1109
caeuProgressEnd
void caeuProgressEnd(CAEP_RTITEM *pRti, PWP_BOOL ok)
Ends all progress tracking.
Definition: apiCAEPUtils.cxx:161
CaePlugin::run
PWP_BOOL run()
Starts the export sequence.
Definition: CaePluginImpl.h:34