Pointwise Plugin SDK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CaeStrConnection.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CaeStrConnection class
4  *
5  * (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide.
6  *
7  ***************************************************************************/
8 
9 #if !defined(PWGM_HIDE_STRUCTURED_API)
10 
11 #ifndef _CAESTRCONNECTION_H_
12 #define _CAESTRCONNECTION_H_
13 
14 #include "apiGridModel.h"
15 #include "apiPWP.h"
16 #include "CaeStrConnectionGroup.h"
17 #include "CaeStrGridModel.h"
18 
19 
67 public:
68 
70 
76  PWGM_HCNXN_SET_INVALID(h_);
77  }
78 
80 
88  PWGM_HCNXN_SET_INVALID(h_);
89  moveTo(group, ndx);
90  }
91 
93 
98  group_ = src.group_;
99  h_ = src.h_;
100  groupNdx_ = src.groupNdx_;
101  }
102 
105  }
106 
110  }
111 
113 
118  PWP_UINT32 index() const {
119  return groupNdx_;
120  }
121 
123 
130  return PWGM_HCNXN_ID(h_);
131  }
132 
134 
138  bool data(PWGM_CNXNDATA &data) const {
139  return 0 != PwConnection(h_, &data);
140  }
141 
144  bool isValid() const {
145  return PWGM_HCNXN_ISVALID(h_);
146  }
147 
149 
155  group_ = rhs.group_;
156  h_ = rhs.h_;
157  groupNdx_ = rhs.groupNdx_;
158  return *this;
159  }
160 
162 
170  group_ = &group;
171  return moveTo(ndx);
172  }
173 
175 
183  if (0 != group_) {
184  groupNdx_ = ndx;
186  }
187  return *this;
188  }
189 
191 
198  group_ = &group;
199  return moveTo(0);
200  }
201 
203 
209  groupNdx_ = 0;
210  if (0 != group_) {
212  }
213  return *this;
214  }
215 
217 
224  return moveTo(groupNdx_ + 1);
225  }
226 
228 
235  CaeStrConnection& operator++() { // pre incr to next element
236  return moveTo(groupNdx_ + 1);
237  }
238 
240 
246  CaeStrConnection operator++(int) { // post incr to next element
247  CaeStrConnection ret = *this;
248  moveTo(groupNdx_ + 1);
249  return ret;
250  }
251 
253 
259  CaeStrConnection& movePrev() { // move to previous element
260  return moveTo(groupNdx_ - 1);
261  }
262 
264 
271  CaeStrConnection& operator--() { // pre decr to previous element
272  return moveTo(groupNdx_ - 1);
273  }
274 
276 
282  CaeStrConnection operator--(int) { // post decr to previous element
283  CaeStrConnection ret = *this;
284  moveTo(groupNdx_ - 1);
285  return ret;
286  }
287 
289  friend bool operator==(const PWGM_HCNXN &h1, const PWGM_HCNXN &h2);
291 
293 
297  bool operator==(const CaeStrConnection &rhs) const {
298  return (rhs.group_ == group_) && (rhs.h_ == h_);
299  }
300 
302 
306  bool operator!=(const CaeStrConnection &rhs) const {
307  return !(rhs == *this);
308  }
309 
311  friend bool operator<(const PWGM_HCNXN &h1, const PWGM_HCNXN &h2);
313 
315 
318  bool operator<(const CaeStrConnection &rhs) const {
319  if (rhs.group_ < group_) {
320  return true;
321  }
322  else if (rhs.group_ > group_) {
323  return false;
324  }
325  return h_ < rhs.h_;
326  }
327 
329 
332  bool operator>(const PWGM_HCNXN &rhs)
333  {
334  return !(*this == rhs) && !(*this < rhs);
335  }
336 
338  operator PWGM_HCNXN() const {
339  return h_;
340  }
341 
342 protected:
343 
347 };
348 
349 #endif // _CAESTRCONNECTION_H_
350 
351 #endif // PWGM_HIDE_STRUCTURED_API
CaeStrConnection operator--(int)
Postfix decrement to the previous connection in the group.
bool data(PWGM_CNXNDATA &data) const
Get information about the connection.
bool operator>(const PWGM_HCNXN &rhs)
Compares the relative order of two CaeStrConnection instances.
~CaeStrConnection()
Destructor.
unsigned int PWP_UINT32
32-bit unsigned integer
Definition: apiPWP.h:210
CaeStrGridModel model() const
Gets the structured grid model of which this connection is a member.
Pointwise Plugin API (PWP-API)
bool isValid() const
Determines a connection&#39;s validity.
CaeStrConnection & operator++()
Prefix increment to the next connection in the group.
CaeStrConnection()
Default constructor.
CaeStrConnection & moveFirst(const CaeStrConnectionGroup &group)
Rebinds an instance to the first connection in the group.
CaeStrConnection & moveFirst()
Rebinds an instance to the first connection in the current group.
PWP_BOOL PwConnection(PWGM_HCNXN connection, PWGM_CNXNDATA *pCnxnData)
Get the connection data.
Pointwise Grid Model API Specification (PWGM-API)
PWGM_HCNXN h_
The bound PWGM_HCNXN.
An opaque handle to a structured, inter-block connection.
Definition: apiGridModel.h:482
CaeStrConnection & moveTo(const CaeStrConnectionGroup &group, PWP_UINT32 ndx)
Rebinds an instance to a specific group and connection.
PWP_UINT32 modelIndex() const
Get the connection&#39;s model index.
CaeStrConnection(const CaeStrConnection &src)
Copy constructor.
#define PWGM_HCNXN_MODEL(h)
gets the connection&#39;s parent PWGM_HGRIDMODEL handle
Definition: apiGridModel.h:502
#define PWGM_HCNXN_ID(h)
gets the connection&#39;s guid from the handle
Definition: apiGridModel.h:500
#define PWGM_HCNXN_ISVALID(h)
returns non-zero value if handle is valid
Definition: apiGridModel.h:484
PWP_UINT32 groupNdx_
The current index in the group&#39;s index space.
bool operator<(const CaeStrConnection &rhs) const
Compares the relative order of two CaeStrConnection instances.
The structured block to block connection group class.
The structured grid model class.
The structured block to block connection class.
CaeStrConnection(const CaeStrConnectionGroup &group, PWP_UINT32 ndx=0)
Group and connection index constructor.
CaeStrConnection & moveNext()
Rebinds an instance to the next connection in the group.
PWGM_HCNXN enumConnections(PWP_UINT32 ndx) const
Get an connection in the group.
const CaeStrConnectionGroup * group_
The owning connection group.
bool operator==(const CaeStrConnection &rhs) const
Compares two CaeStrConnection instances for equality.
bool operator!=(const CaeStrConnection &rhs) const
Compares two CaeStrConnection instances for inequality.
CaeStrConnection & operator=(const CaeStrConnection &rhs)
Assignment operator.
CaeStrConnection operator++(int)
Postfix increment to the next connection in the group.
Structured grid, inter-block, connection data type.
Definition: apiGridModel.h:961
PWP_UINT32 index() const
Get the connection&#39;s index in the group.
CaeStrConnection & moveTo(PWP_UINT32 ndx)
Rebinds an instance to a specific connection within the current group.
CaeStrConnection & movePrev()
Rebinds an instance to the previous connection in the group.
CaeStrConnection & operator--()
Prefix decrement to the previous connection in the group.