CFx SDK Documentation  2020SP3
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
OdResult
Definition: OdResult.h:29
OdDAI::OdSelect::OdSelect
OdSelect()
OdDAI::OdSelect::setBool
void setBool(bool val)
OdDAI::OdSelect::getHandleArray
bool getHandleArray(OdArray< OdDAIObjectId > &res) const
OdDAI::OdSelect::getBINARY
bool getBINARY(OdAnsiString &res) const
OdDAIObjectId
Definition: daiObjectId.h:67
OdDAI::OdSelect::setDouble
void setDouble(double val)
OdDAI::OdSelect::in
OdResult in(OdSpfFilerBase *rdFiler, bool opt=false, bool comma_needed=true)
OdDAI::OdSelect::getInt32
bool getInt32(int &ret) const
OdDAI::OdSelect::getHandle
bool getHandle(OdDAIObjectId &res) const
OdDAI::OdSelect::OdSelectKind
OdSelectKind
Definition: daiSelect.h:47
OdDAI::OdSelect::kind
OdSelectKind kind() const
OdDAI::OdSelect::getHandle
OdDAIObjectId getHandle() const
OdDAI::OdSelect::writeTypedField
virtual OdResult writeTypedField(OdSpfFilerBase *wrFiler) const
OdDAI::OdLogical
Definition: daiPrimitive.h:47
OdDAI::BINARY
OdAnsiString BINARY
Definition: daiPrimitive.h:94
OdArray< int >
OdDAI::OdSelect::setHandleD
virtual void setHandleD()=0
OdDAI::OdSelect::unset
virtual void unset()=0
OdDAI
Definition: daiAccessDefines.h:31
OdDAI::OdSelect::setDoubleArray
void setDoubleArray(OdArray< double > &val)
OdDAI::OdSelect::getInt32Array
bool getInt32Array(OdArray< int > &res) const
OdDAI::OdSelect::setInt32Array
void setInt32Array(OdArray< int > &val)
OdDAI::OdSelect::m_kind
OdSelectKind m_kind
Definition: daiSelect.h:308
OdDAI::OdSelect::setBINARY
void setBINARY(BINARY &val)
OdDAI::OdSelect::nullify
virtual void nullify()
OdDAI::OdSelect::m_int
int m_int
Definition: daiSelect.h:311
OdDAI::OdSelect::setString
void setString(OdAnsiString &val)
OdDAI::OdSelect::~OdSelect
virtual ~OdSelect()
OdDAI::OdSelect::m_bool
bool m_bool
Definition: daiSelect.h:312
OdDAI::OdSelect::m_hndl
OdUInt64 m_hndl
Definition: daiSelect.h:310
OdDAI::OdSelect::setHandle
void setHandle(OdDAIObjectId val)
OdDAI::OdSelect::getString
bool getString(OdAnsiString &ret) const
OdDAI::OdSelect::setInt32
void setInt32(int val)
OdDAI::OdSelect::m_ptr
void * m_ptr
Definition: daiSelect.h:314
OdDAI::OdSelect::underlyingTypeName
virtual const OdAnsiString underlyingTypeName() const =0
OdDAI::OdSelect::getBINARY
bool getBINARY(char *&res) const
daiPrimitive.h
OdDAI::OdSelect::setLogical
void setLogical(OdLogical &val)
OdDAI::OdSelect::getBool
bool getBool(bool &ret) const
OdDAI::OdSelect::getLogical
bool getLogical(OdLogical &ret) const
OdDAI::OdSelect::m_dbl
double m_dbl
Definition: daiSelect.h:313
OdDAI::OdSelect::setHandleArray
void setHandleArray(OdArray< OdDAIObjectId > &val)
OdDAI::OdSelect
Definition: daiSelect.h:41
OdDAI::OdSelect::getDouble
bool getDouble(double &ret) const
OdDAI::OdSelect::underlyingTypeName
virtual bool underlyingTypeName(OdAnsiString typeName)=0
OdDAI::OdSelect::out
void out(OdSpfFilerBase *wrFiler, bool opt=false, bool comma_needed=true)
OdDAI::OdSelect::readTypedField
virtual OdResult readTypedField(const OdAnsiString &typeDef, OdSpfFilerBase *rdFiler)
OdDAI::OdSelect::getDoubleArray
bool getDoubleArray(OdArray< double > &res) const
OdDAI::OdSelect::OdSelect
OdSelect(const OdSelect &other)
DAI_EXPORT
#define DAI_EXPORT
Definition: daiBuildOptions.h:28
OdDAI::OdSelect::exists
virtual int exists() const =0
OdDAI::OdSelect::_d
virtual long _d() const =0
daiObjectId.h
OdUInt64
Definition: Int64.h:137