CFx SDK Documentation  2022 SP0
daiSelect.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2019, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Open Design Alliance software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Open Design Alliance Copyright (C) 2002-2019 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef _DAI_SELECT_H_
25 #define _DAI_SELECT_H_
26 
27 #include "daiPrimitive.h"
28 #include "daiObjectId.h"
29 
33 namespace OdDAI {
34 
35  class OdSpfFilerBase;
36 
41  {
42  public:
43 
47  typedef enum {
48  kUnset = 0, // The value is not set.
49  kObjectId = 1, // An object identifier's value.
50  kInt32 = 2, // An unsigned 32-bit integer value.
51  kBoolean = 3, // A boolean value.
52  kDouble = 4, // A double value.
53  kBinary = 5, // A binary value.
54  kLogical = 6, // A logical value.
55  kObjectIdArray = 7, // An array of object identifiers.
56  kInt32Array = 8, // An array of unsigned 32-bit integer values.
57  kDoubleArray = 9, // An array of double values.
58  kAnsiString = 10 // An ANSI string.
59  } OdSelectKind;
60 
65  OdSelect(const OdSelect &other);
66 
71 
75  virtual ~OdSelect();
76 
84  OdSelect& operator = (const OdSelect &other);
85 
90  virtual int exists() const = 0;
91 
96  virtual long _d() const = 0;
97 
101  virtual void nullify();
102 
108 
113  virtual const OdAnsiString underlyingTypeName() const = 0;
114 
120  virtual bool underlyingTypeName(OdAnsiString typeName) = 0;
121 
127 
132  void setInt32(int val);
133 
138  void setBool(bool val);
139 
144  void setDouble(double val);
145 
150  void setString(OdAnsiString &val);
151 
156  void setBINARY(BINARY &val);
157 
162  void setLogical(OdLogical &val);
163 
169 
175 
181 
187  bool getInt32(int &ret) const;
188 
194  bool getDouble(double &ret) const;
195 
201  bool getBool(bool &ret) const;
202 
208  bool getString(OdAnsiString &ret) const;
209 
215  bool getHandle(OdDAIObjectId &res) const;
216 
222 
228  bool getLogical(OdLogical &ret) const;
229 
235  bool getBINARY(OdAnsiString &res) const;
236 
242  bool getInt32Array(OdArray<int> &res) const;
243 
250 
256  bool getDoubleArray(OdArray<double> &res) const;
257 
263  bool getBINARY(char* &res) const;
264 
273  OdResult in(OdSpfFilerBase *rdFiler, bool opt = false, bool comma_needed = true);
274 
283  void out(OdSpfFilerBase *wrFiler, bool opt = false, bool comma_needed = true);
284 
285 //DOM-IGNORE-BEGIN
286  protected:
287 
291  virtual void setHandleD() = 0;
292 
296  virtual void unset() = 0;
297 
301  virtual OdResult readTypedField(const OdAnsiString &typeDef, OdSpfFilerBase *rdFiler);
302 
306  virtual OdResult writeTypedField(OdSpfFilerBase *wrFiler) const;
307 
309  union {
311  int m_int;
312  bool m_bool;
313  double m_dbl;
314  void* m_ptr;
315 //DOM-IGNORE-END
316  };
317 
318  };
319 
320 }
321 
322 #endif // _DAI_SELECT_H_
OdResult
Definition: OdResult.h:29
bool getDouble(double &ret) const
virtual ~OdSelect()
void setInt32Array(OdArray< int > &val)
OdUInt64 m_hndl
Definition: daiSelect.h:310
virtual OdResult readTypedField(const OdAnsiString &typeDef, OdSpfFilerBase *rdFiler)
virtual int exists() const =0
virtual OdResult writeTypedField(OdSpfFilerBase *wrFiler) const
void out(OdSpfFilerBase *wrFiler, bool opt=false, bool comma_needed=true)
bool getBINARY(char *&res) const
void setInt32(int val)
OdSelectKind kind() const
bool getInt32(int &ret) const
virtual long _d() const =0
bool getBool(bool &ret) const
bool getHandle(OdDAIObjectId &res) const
OdSelect(const OdSelect &other)
bool getString(OdAnsiString &ret) const
bool getInt32Array(OdArray< int > &res) const
virtual bool underlyingTypeName(OdAnsiString typeName)=0
void setDoubleArray(OdArray< double > &val)
bool getDoubleArray(OdArray< double > &res) const
virtual void unset()=0
bool getHandleArray(OdArray< OdDAIObjectId > &res) const
virtual void nullify()
void setHandleArray(OdArray< OdDAIObjectId > &val)
void setBool(bool val)
void setHandle(OdDAIObjectId val)
OdResult in(OdSpfFilerBase *rdFiler, bool opt=false, bool comma_needed=true)
void setBINARY(BINARY &val)
bool getBINARY(OdAnsiString &res) const
void setString(OdAnsiString &val)
virtual void setHandleD()=0
virtual const OdAnsiString underlyingTypeName() const =0
OdDAIObjectId getHandle() const
OdSelectKind m_kind
Definition: daiSelect.h:308
void setLogical(OdLogical &val)
bool getLogical(OdLogical &ret) const
void setDouble(double val)
#define DAI_EXPORT
OdAnsiString BINARY
Definition: daiPrimitive.h:94