CFx SDK Documentation  2022 SP0
daiAny.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_ANY_H_
25 #define _DAI_ANY_H_
26 
27 #include "OdPlatformSettings.h"
28 #include "OdArray.h"
29 
30 #include "daiBuildOptions.h"
31 #include "daiPrimitive.h"
32 #include "daiTCKind.h"
33 #include "daiSelect.h"
34 
35 class OdDAIObjectId;
36 class OdTypeCode;
37 
40 {
41 public:
42 
44 
45  OdAny();
46  OdAny(const OdAny &other);
47  OdAny(const OdTypeCodePtr typeCode, void *val, unsigned int size = 1) : m_size(size), m_val(val), m_typeCode(typeCode), m_release(false) {};
48 
49  ~OdAny();
50 
51  const void* value() const { return m_val; };
52  unsigned int size() const { return m_size; };
53  const OdTypeCodePtr type() const ;
54  OdTCKind kind() const;
55  void kind(OdTCKind kind);
56  void reset();
57 
59  bool setTypePath(OdTypeCodePtr typeCode);
60 
61  //
62  // Single variable
63  //
64  void operator << (const short val);
65  bool operator >> (short &val) const;
66 
67  void operator << (const unsigned short val);
68  bool operator >> (unsigned short &val) const;
69 
70  void operator << (const int val);
71  bool operator >> (int &val) const;
72 
73  void operator << (const unsigned long val);
74  bool operator >> (unsigned long &val) const;
75 
76  void operator << (const float val);
77  bool operator >> (float &val) const;
78 
79  void operator << (const OdDAI::OdLogical &val);
80  bool operator >> (OdDAI::OdLogical &val) const;
81 
82  void operator << (const bool val);
83  bool operator >> (bool &val) const;
84 
85  void operator << (const double val);
86  bool operator >> (double &val) const;
87 
88  void operator << (const OdString &val);
89  bool operator >> (OdString &val) const;
90 
91  void operator << (const char *val);
92  void operator << (const OdAnsiString &val);
93  bool operator >> (OdAnsiString &val) const;
94 
95  void operator << (const OdDAIObjectId &val);
96  bool operator >> (OdDAIObjectId &val) const;
97 
98  void operator << (const OdTypeCodePtr val);
99  bool operator >> (OdTypeCodePtr &val) const;
100 
101  bool operator >> (OdAny& val) const;
103 
104  //
105  // Aggregates
106  //
107  void operator << (const OdArray<short> &val);
108  bool operator >> (OdArray<short> &val) const;
109 
110  void operator << (const OdArray<unsigned short> &val);
112 
113  void operator << (const OdArray<int> &val);
114  bool operator >> (OdArray<int> &val) const;
115  void operator << (const OdArray<OdArray<int> > &val);
116  bool operator >> (OdArray<OdArray<int> > &val) const;
117 
118  void operator << (const OdArray<unsigned long> &val);
120 
121  void operator << (const OdArray<float> &val);
122  bool operator >> (OdArray<float> &val) const;
123 
124  void operator << (const OdArray<double> &val);
125  bool operator >> (OdArray<double> &val) const;
126  void operator << (const OdArray<OdArray<double> > &val);
128 
129  void operator << (const OdArray<OdDAI::OdLogical> &val);
131 
132  void operator << (const OdArray<bool> &val);
133  bool operator >> (OdArray<bool> &val) const;
134 
135  void operator << (const OdArray<OdString> &val);
136  bool operator >> (OdArray<OdString> &val) const;
137 
138  void operator << (const OdArray<OdAnsiString> &val);
140 
141  void operator << (const OdArray<OdDAIObjectId> &val);
143  void operator << (const OdArray<OdArray<OdDAIObjectId> > &val);
145 
146  void operator << (const OdArray<const OdTypeCode*> &val);
148 
149  void operator << (const OdArray<OdAny> &val);
150  bool operator >> (OdArray<OdAny> &val) const;
152 
153  bool operator == (const OdAny& right) const;
154  bool operator != (const OdAny& right) const;
155  OdAny& operator = (const OdAny&);
156 
157  //DOM-IGNORE-BEGIN
158  //For internal use only.
159  void assignArray(const double *arr, int size);
160  //DOM-IGNORE-END
161 
162 private:
163  void copy(const OdAny& other);
164  void clear();
165  void setTypeCode(OdTCKind tk);
166 
167  class Prop;
168 private:
169 
170  unsigned int m_size;
171  const void *m_val;
172  OdTypeCodePtr m_typeCode;
173  mutable bool m_release;
174 
175 };
176 
178 
179 
180 
181 
182 #endif // _DAI_ANY_H_
false
Definition: DimVarDefs.h:165
Definition: daiAny.h:40
const OdTypeCodePtr type() const
bool getTypePath(OdArray< OdAnsiString > &path)
void assignArray(const double *arr, int size)
OdAny(const OdTypeCodePtr typeCode, void *val, unsigned int size=1)
Definition: daiAny.h:47
OdAny(const OdAny &other)
void reset()
void kind(OdTCKind kind)
const void * value() const
Definition: daiAny.h:51
bool setTypePath(OdTypeCodePtr typeCode)
static DAI_EXPORT_STATIC const OdAny kEmpty
Definition: daiAny.h:43
OdTCKind kind() const
unsigned int size() const
Definition: daiAny.h:52
OdSharedPtr< OdTypeCode > OdTypeCodePtr
Definition: daiAny.h:36
OdArray< OdAny > OdAnyArray
Definition: daiAny.h:177
#define DAI_EXPORT
#define DAI_EXPORT_STATIC
OdTCKind
Definition: daiTCKind.h:28
GLsizeiptr size
Definition: gles2_ext.h:182
bool DAI_EXPORT operator!=(const OdDAI::OdSelect &left, const OdDAI::OdSelect &right)
bool DAI_EXPORT operator==(const OdFileDescriptionAuto &left, const OdFileDescriptionAuto &right)
bool operator>>(const OdRxValue &out, IfcActionSourceTypeEnum &in)