CFx SDK Documentation  2022 SP0
RxMember.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2018, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2018 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 _ODRXMEMBER_INCLUDED_
25 #define _ODRXMEMBER_INCLUDED_
26 
27 #include "OdString.h"
28 #include "OdArray.h"
29 #include "RxOverrule.h"
30 #include "SharedPtr.h"
31 
32 class OdRxValue;
33 class OdRxValueType;
36 
37 class OdRxMemberIteratorImpl;
38 class OdRxMemberQueryContextImpl;
39 class OdRxMemberQueryEngineImpl;
40 class OdRxMemberImpl;
41 class OdRxMemberCollectionImpl;
42 
43 class OdRxMember;
45 
52 {
53 public:
55 
59  const OdString& name() const throw();
60 
64  OdString localName() const throw();
65 
69  const OdRxValueType& type()const throw();
70 
75  const OdRxAttributeCollection& attributes() const throw();
76  OdRxAttributeCollection& attributes() throw();
77 
81  const OdRxObject* owner() const throw();
82 
86  const OdArray<OdRxMemberPtr>* children() const throw();
87 
91  static void deleteMember(const OdRxMember* pMember) throw();
92 protected:
93  friend class OdRxMemberImpl;
94  virtual ~OdRxMember();
95  OdRxMember(OdRxMemberImpl*);
96 
100  virtual OdString subLocalName() const;
101 
106  virtual OdResult subChildren(OdArray<OdRxMemberPtr>& children) const;
107 
111  virtual OdResult subChildrenEx(OdArray<OdRxMemberPtr>*& pChildren) const;
112 
116  void init(const OdString& name, const OdRxValueType* type, const OdRxObject* owner = 0);
117  OdRxMemberImpl* m_pImpl;
118 };
119 
120 
121 class OdRxEnumTag;
123 class OdRxEnumTagImpl;
124 
130 {
131 public:
139  static OdRxEnumTagPtr createObject(const OdChar* name, const OdRxValue& value, const OdRxObject* owner);
140 
144  const OdRxValue& value() const;
145 
150 protected:
151  OdRxEnumTag(OdRxMemberImpl*);
156 };
157 
163 {
164 public:
169  virtual int count() const = 0;
173  virtual OdRxMember* getAt(int index) const = 0;
174 };
175 
181 {
182 public:
186  void add(OdRxMember* member);
187 
191  const OdRxClass* owner() const { return m_owner; }
192 private:
193  friend class OdRxMemberCollectionImpl;
194  OdRxMemberCollectionBuilder(OdRxMemberCollectionImpl* imp, const OdRxClass* owner) : m_pImpl(imp), m_owner(owner) {}
195  const OdRxClass* m_owner;
196  OdRxMemberCollectionImpl* m_pImpl;
197 };
198 
204 {
205 public:
210  virtual bool done();
214  virtual bool next();
218  virtual OdRxMember* current() const;
222  virtual OdRxMember* find(const OdChar* name) const;
223 protected:
225 private:
226  friend class OdRxMemberIteratorImpl;
227  OdRxMemberIteratorImpl* m_pImpl;
228 };
229 
231 
232 
240 {
241 public:
248 protected:
249  friend class OdRxMemberQueryContextImpl;
250  OdRxMemberQueryContextImpl* m_pImpl;
254 };
255 
256 
262 {
264 
269  virtual void getFacets(const OdRxObject* pO, const OdRxMemberQueryContext* pContext, OdArray<OdRxClassPtr>& facets) = 0;
270 };
271 
273 
279 {
280 public:
281  virtual ~OdRxMemberReactor() {}
285  virtual void goodbye(const OdRxMember* ) {}
286 };
287 
288 
294 {
295 public:
300 
304  OdRxMember* find(const OdRxObject* pO, const OdChar* name, const OdRxMemberQueryContext* pContext = NULL) const;
305 
310 
316 
323 
328 
333 
337  void addReactor(OdRxMemberReactor* pReactor);
338 
343 private:
344  friend class OdRxMemberQueryEngineImpl;
345  OdRxMemberQueryEngineImpl* m_pImpl;
346  OdRxMemberQueryEngine(OdRxMemberQueryEngineImpl*);
347 };
348 
349 
357 {
358 public:
363  static OdResult addOverrule(OdRxMember* pOverruledSubject, OdRxMemberOverrule* pOverrule, bool bAddAtLast = false);
367  static OdResult removeOverrule(OdRxMember* pOverruledSubject, OdRxMemberOverrule* pOverrule);
368 };
369 
370 #endif
#define NULL
Definition: GsProperties.h:177
#define ODRX_ABSTRACT
wchar_t OdChar
OdResult
Definition: OdResult.h:29
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdSmartPtr< OdRxMember > OdRxMemberPtr
Definition: RxMember.h:43
OdSmartPtr< OdRxFacetProvider > OdRxFacetProviderPtr
Definition: RxMember.h:272
OdSharedPtr< OdRxMemberIterator > OdRxMemberIteratorPtr
Definition: RxMember.h:230
ODRX_DECLARE_MEMBERS(OdRxEnumTag)
OdRxEnumTag(OdRxMemberImpl *)
static OdRxEnumTagPtr createObject(const OdChar *name, const OdRxValue &value, const OdRxObject *owner)
virtual OdString subAlternateLocalName() const
const OdRxValue & value() const
OdString alternateLocalName() const
const OdRxClass * owner() const
Definition: RxMember.h:191
void add(OdRxMember *member)
virtual int count() const =0
virtual ~OdRxMemberCollection()
virtual OdRxMember * getAt(int index) const =0
const OdString & name() const
ODRX_DECLARE_MEMBERS(OdRxMember)
virtual OdRxMember * find(const OdChar *name) const
virtual ~OdRxMemberIterator()
virtual bool next()
virtual bool done()
virtual OdRxMember * current() const
ODRX_DECLARE_MEMBERS(OdRxMemberOverrule)
static OdResult addOverrule(OdRxMember *pOverruledSubject, OdRxMemberOverrule *pOverrule, bool bAddAtLast=false)
static OdResult removeOverrule(OdRxMember *pOverruledSubject, OdRxMemberOverrule *pOverrule)
OdRxMemberIteratorPtr newMemberIterator(const OdArray< OdRxClassPtr > &facets) const
virtual OdRxMemberIteratorPtr subNewMemberIterator(const OdArray< OdRxClassPtr > &facets) const =0
ODRX_DECLARE_MEMBERS(OdRxMemberQueryContext)
OdRxMemberQueryContextImpl * m_pImpl
Definition: RxMember.h:250
virtual ~OdRxMemberQueryContext()
const OdRxPromotingQueryContext * promotingContext() const
void removeFacetProvider(OdRxFacetProvider *pProvider)
void addFacetProvider(OdRxFacetProvider *pProvider)
OdRxMemberIteratorPtr newMemberIterator(const OdRxObject *pO, const OdRxMemberQueryContext *pContext=NULL) const
OdRxMember * find(const OdRxObject *pO, const OdChar *name, const OdRxMemberQueryContext *pContext=NULL) const
void addReactor(OdRxMemberReactor *pReactor)
const OdRxMemberQueryContext * defaultContext() const
void removeReactor(OdRxMemberReactor *pReactor)
static OdRxMemberQueryEngine * theEngine()
virtual void goodbye(const OdRxMember *)
Definition: RxMember.h:285
virtual ~OdRxMemberReactor()
Definition: RxMember.h:281
GLuint index
Definition: gles2_ext.h:265
GLuint const GLchar * name
Definition: gles2_ext.h:265
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLsizei const GLfloat * value
Definition: gles2_ext.h:302
ODRX_DECLARE_MEMBERS(OdRxFacetProvider)
virtual void getFacets(const OdRxObject *pO, const OdRxMemberQueryContext *pContext, OdArray< OdRxClassPtr > &facets)=0