NX Open C++ 参考指南 2406 v1.1
载入中...
搜索中...
未找到
ScalarCollection.hxx
1//--------------------------------------------------------------------------
2// Copyright 2024 Siemens
3//--------------------------------------------------------------------------
4// JA API的C++接口头文件
5//--------------------------------------------------------------------------
6//
7// 源文件:
8// ScalarCollection.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/Scalar.hxx>
24#include <NXOpen/SmartObject.hxx>
25#include <NXOpen/TaggedObject.hxx>
26#include <NXOpen/libnxopencpp_exports.hxx>
27#ifdef _MSC_VER
28#pragma warning(push)
29#pragma warning(disable:4996)
30#endif
31#ifdef __GNUC__
32#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
33#endif
34namespace NXOpen
35{
36 class ScalarCollection;
37 class BasePart;
38 class Scalar;
39 class Expression;
40 class ScalarCollectionImpl;
46 class NXOPENCPPEXPORT ScalarCollection : public NXOpen::TaggedObjectCollection
47 {
48 private: ScalarCollectionImpl * m_scalarcollection_impl;
49 private: NXOpen::BasePart* m_owner;
51 public: explicit ScalarCollection(NXOpen::BasePart *owner);
53 public:
55 tag_t Tag() const;
56 public: ~ScalarCollection();
58 //lint -sem(NXOpen::ScalarCollection::iterator::copy,initializer)
59 class iterator : public std::iterator<std::forward_iterator_tag, NXOpen::Scalar *>
60 {
61 public:
63 iterator() : m_context(nullptr), m_current(NULL_TAG)
64 {
65 // coverity[uninit_member]
66 } //lint !e1401 m_state未初始化
67
68 explicit iterator(NXOpen::ScalarCollection *context) : m_context(context), m_current(NULL_TAG)
69 {
70 // coverity[uninit_member]
71 }//lint !e1401 m_state未初始化
73
74 iterator(const iterator &other): m_context(nullptr), m_current(NULL_TAG)
75 {
76 copy(other);
77 }
78
79 iterator &operator =(const iterator &other)
80 {
81 if (&other != this)
82 copy(other);
83 return *this;
84 }
85
86 bool operator ==(const iterator &other) const
87 {
88 return m_current == other.m_current && m_context == other.m_context;
89 }
90
91 bool operator !=(const iterator &other) const
92 {
93 return !operator == (other);
94 }
95
96 NXOPENCPPEXPORT value_type operator * () const;
98 iterator & operator ++()
99 {
100 next();
101 return *this;
102 }
103
104 iterator operator ++(int)
105 {
106 iterator tmp(*this);
107 ++*this;
108 return tmp;
109 }
110 private:
111 void copy(const iterator &other)
112 {
113 m_context = other.m_context;
114 m_current = other.m_current;
115 for (int i = 0; i < sizeof(m_state)/sizeof(m_state[0]); i++)
116 m_state[i] = other.m_state[i];
117 }
118 NXOPENCPPEXPORT void next();
119 NXOpen::ScalarCollection *m_context;
120 tag_t m_current;
121 unsigned int m_state[8];
122 };
123
127 {
128 return iterator(this);
129 }
130
135 (
136 double value ,
139 );
145 (
146 NXOpen::Scalar * scalarExtract ,
147 NXOpen::Scalar * scalarOptional ,
150 );
156 (
157 NXOpen::Expression * expression ,
160 );
166 (
167 NXOpen::Scalar * scalar ,
170 );
171 }; //lint !e1712 类未定义默认构造函数
172}
173#ifdef _MSC_VER
174#pragma warning(pop)
175#endif
176#ifdef __GNUC__
177#ifndef NX_NO_GCC_DEPRECATION_WARNINGS
178#pragma GCC diagnostic warning "-Wdeprecated-declarations"
179#endif
180#endif
181#undef EXPORTLIBRARY