NX Open C++ 参考指南 2406 v1.1
载入中...
搜索中...
未找到
UnitCollection.hxx
1//--------------------------------------------------------------------------
2// Copyright 2024 Siemens
3//--------------------------------------------------------------------------
4// C++接口头文件:JA API
5//--------------------------------------------------------------------------
6//
7// 源文件:
8// UnitCollection.ja
9//
10// 生成工具:
11// apiwrap
12//
13// 警告:
14// 此文件为自动生成,请勿手动编辑
15//
16#pragma once
17#include <NXOpen/NXDeprecation.hxx>
18#include <iterator>
19#include <vector>
20#include <NXOpen/NXString.hxx>
21#include <NXOpen/Callback.hxx>
22#include <NXOpen/TaggedObjectCollection.hxx>
23#include <NXOpen/TaggedObject.hxx>
24#include <NXOpen/libnxopencpp_exports.hxx>
25#ifdef _MSC_VER
26#pragma warning(push)
27#pragma warning(disable:4996)
28#endif
29#ifdef __GNUC__
30#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
31#endif
32namespace NXOpen
33{
34 class UnitCollection;
35 class BasePart;
36 class Unit;
37 class UnitCollectionImpl;
41 class NXOPENCPPEXPORT UnitCollection : public NXOpen::TaggedObjectCollection
42 {
72 private: UnitCollectionImpl * m_unitcollection_impl;
73 private: NXOpen::BasePart* m_owner;
75 public: explicit UnitCollection(NXOpen::BasePart *owner);
77 public:
79 tag_t Tag() const;
80 public: ~UnitCollection();
82 //lint -sem(NXOpen::UnitCollection::iterator::copy,initializer)
83 class iterator : public std::iterator<std::forward_iterator_tag, NXOpen::Unit *>
84 {
85 public:
87 iterator() : m_context(nullptr), m_current(NULL_TAG)
88 {
89 // coverity[uninit_member]
90 } //lint !e1401 m_state未初始化
91
92 explicit iterator(NXOpen::UnitCollection *context) : m_context(context), m_current(NULL_TAG)
93{
94 // coverity[uninit_member]
95 }//lint !e1401 m_state is not initialized
97
98 iterator(const iterator &other): m_context(nullptr), m_current(NULL_TAG)
99 {
100 copy(other);
101 }
102
103 iterator &operator =(const iterator &other)
104 {
105 if (&other != this)
106 copy(other);
107 return *this;
108 }
109
110 bool operator ==(const iterator &other) const
111 {
112 return m_current == other.m_current && m_context == other.m_context;
113 }
114
115 bool operator !=(const iterator &other) const
116 {
117 return !operator == (other);
118 }
119
120 NXOPENCPPEXPORT value_type operator * () const;
122 iterator & operator ++()
123 {
124 next();
125 return *this;
126 }
127
128 iterator operator ++(int)
129 {
130 iterator tmp(*this);
131 ++*this;
132 return tmp;
133 }
134 private:
135 void copy(const iterator &other)
136 {
137 m_context = other.m_context;
138 m_current = other.m_current;
139 for (int i = 0; i < sizeof(m_state)/sizeof(m_state[0]); i++)
140 m_state[i] = other.m_state[i];
141 }
142 NXOPENCPPEXPORT void next();
143 NXOpen::UnitCollection *m_context;
144 tag_t m_current;
145 unsigned int m_state[8];
146 };
147
151 {
152 return iterator(this);
153 }
154
158 (
160 );
165 (
166 );
171 (
173 );
178 (
179 );
184 (
185 const NXString & name
186 );
191 (
192 const char * name
193 );
198 public: std::vector<NXString> GetMeasures
199 (
200 );
204 public: std::vector<NXOpen::Unit *> GetMeasureTypes
205 (
206 const NXString & measureName
207 );
211 std::vector<NXOpen::Unit *> GetMeasureTypes
212 (
213 const char * measureName
214 );
220 (
221 const NXString & measureName
222 );
228 (
229 const char * measureName
230 );
234 public: double Convert
235 (
236 NXOpen::Unit * initialUnitType ,
237 NXOpen::Unit * targetUnitType ,
238 double initialValue
239 );
244 (
245 const NXString & measureName
246 );
251 (
252 const char * measureName
253 );
258 (
259 const NXString & measureName
260 );
265 (
266 const char * measureName
267 );
268 }; //lint !e1712 default constructor not defined for class
269}
270#ifdef _MSC_VER
271#pragma warning(pop)
272#endif
273#ifdef __GNUC__
274#ifndef NX_NO_GCC_DEPRECATION_WARNINGS
275#pragma GCC diagnostic warning "-Wdeprecated-declarations"
276#endif
277#endif
278#undef EXPORTLIBRARY