NX Open C++ 参考指南 2406 v1.1
载入中...
搜索中...
未找到
Rule_RuleObjectCollection.hxx
1//--------------------------------------------------------------------------
2// Copyright 2024 Siemens
3//--------------------------------------------------------------------------
4// JA API的C++接口头文件
5//--------------------------------------------------------------------------
6//
7// 源文件:
8// Rule_RuleObjectCollection.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/libruleopencpp_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 namespace Rule
35 {
37 }
38 namespace Rule
39 {
40 class RuleInstance;
41 }
42 namespace Rule
43 {
44 class RuleObject;
45 }
46 namespace Rule
47 {
48 class RuleObjectCollectionImpl;
54 {
55 private: RuleObjectCollectionImpl * m_ruleobjectcollection_impl;
56 private: NXOpen::Rule::RuleInstance* m_owner;
58 public: explicit RuleObjectCollection(NXOpen::Rule::RuleInstance *owner);
60 public:
62 tag_t Tag() const;
63 public: ~RuleObjectCollection();
65 //lint -sem(NXOpen::Rule::RuleObjectCollection::iterator::copy,initializer)
66 class iterator : public std::iterator<std::forward_iterator_tag, NXOpen::Rule::RuleObject *>
67 {
68 public:
70 iterator() : m_context(nullptr), m_current(NULL_TAG)
71 {
72 // coverity[uninit_member]
73 } //lint !e1401 m_state未初始化
74
75 explicit iterator(NXOpen::Rule::RuleObjectCollection *context) : m_context(context), m_current(NULL_TAG)
76 {
77 // coverity[uninit_member]
78 }//lint !e1401 m_state未初始化
80
81 iterator(const iterator &other): m_context(nullptr), m_current(NULL_TAG)
82 {
83 copy(other);
84 }
85
86 iterator &operator =(const iterator &other)
87 {
88 if (&other != this)
89 copy(other);
90 return *this;
91 }
92
93 bool operator ==(const iterator &other) const
94 {
95 return m_current == other.m_current && m_context == other.m_context;
96 }
97
98 bool operator !=(const iterator &other) const
99 {
100 return !operator == (other);
101 }
102
103 RULEOPENCPPEXPORT value_type operator * () const;
105 iterator & operator ++()
106 {
107 next();
108 return *this;
109 }
110
111 iterator operator ++(int)
112 {
113 iterator tmp(*this);
114 ++*this;
115 return tmp;
116 }
117 private:
118 void copy(const iterator &other)
119 {
120 m_context = other.m_context;
121 m_current = other.m_current;
122 for (int i = 0; i < sizeof(m_state)/sizeof(m_state[0]); i++)
123 m_state[i] = other.m_state[i];
124 }
125 RULEOPENCPPEXPORT void next();
127 tag_t m_current;
128 unsigned int m_state[8];
129 };
130
134 {
135 return iterator(this);
136 }
137
141 public: NXOpen::Rule::RuleObject * FindObject
142 (
143 const NXString & journalIdentifier
144 );
149 NXOpen::Rule::RuleObject * FindObject
150 (
151 const char * journalIdentifier
152 );
153 }; //lint !e1712 类未定义默认构造函数
154 }
155}
156#ifdef _MSC_VER
157#pragma warning(pop)
158#endif
159#ifdef __GNUC__
160#ifndef NX_NO_GCC_DEPRECATION_WARNINGS
161#pragma GCC diagnostic warning "-Wdeprecated-declarations"
162#endif
163#endif
164#undef EXPORTLIBRARY