CFx SDK Documentation  2020SP3
daiEntity.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 #include "OdaCommon.h"
25 #include "daiModule.h"
26 #include "daiAttribute.h"
27 
28 #ifndef _DAI_ENTITY_H_
29 #define _DAI_ENTITY_H_
30 
34 namespace OdDAI {
35 
36  class EntityImpl;
37 
41  class DAI_EXPORT Entity : public DictionaryInstance
42  {
43  public:
44 
45  //DOM-IGNORE-BEGIN
46  ODRX_DECLARE_MEMBERS(Entity);
47  //DOM-IGNORE-END
48 
52  Entity()
53  : m_instantiable(false)
54  {};
55 
61  Entity(OdAnsiString name, bool instantiable)
62  : m_name(name)
63  , m_instantiable(instantiable)
64  {};
65 
66 //DOM-IGNORE-BEGIN
76  static OdSmartPtr<Entity> createObject(
77  const char *schemaName,
78  const char *entityName,
79  bool instantiable,
80  Entity* &thisClassDef,
81  Entity* pBaseClass = NULL);
82 //DOM-IGNORE-END
83 
88  const OdAnsiString name() const { return m_name; };
89 
96  const AttributeArr& attributes() const
97  {
98  return m_attributes;
99  };
100 
105  const std::list<Entity*>& supertypes() const
106  {
107  return m_supertypes;
108  };
109 
110 
116  bool isSupertypeOf(const Entity* subtype) const;
117 
118 
123  bool instantiable() const {
124  return m_instantiable;
125  };
126 
127 //DOM-IGNORE-BEGIN
132  void appendAttribute(AttributePtr attributeDef)
133  {
134  m_attributes.push_back(attributeDef);
135  attributeDef->setParentEntity(this);
136  }
137 
142  void appendSuperType(Entity *supertype)
143  {
144  m_supertypes.push_back(supertype);
145  }
146 
147  private:
148 
149  OdAnsiString m_name;
150  AttributeArr m_attributes;
151  std::list<Entity*> m_supertypes;
152  bool m_instantiable;
153  //bool m_complex;
154  //bool m_independent;
155 //DOM-IGNORE-END
156 
157  };
158 
162  typedef OdSmartPtr<Entity> EntityPtr;
163 
167  typedef OdRxDictionaryPtr EntitySet;
168 
172  typedef std::list<EntityPtr > EntityList;
173 
174 }
175 
176 #endif // _DAI_ENTITY_H_
NULL
#define NULL
Definition: GsProperties.h:177
name
GLuint const GLchar * name
Definition: gles2_ext.h:265
false
false
Definition: DimVarDefs.h:165
daiModule.h
OdDAI
Definition: daiAccessDefines.h:31
OdSmartPtr
Definition: SmartPtr.h:58
OdDAI::AttributePtr
OdSmartPtr< Attribute > AttributePtr
Definition: daiEntityInstance.h:40
OdaCommon.h
DAI_EXPORT
#define DAI_EXPORT
Definition: daiBuildOptions.h:28
ODRX_DECLARE_MEMBERS
#define ODRX_DECLARE_MEMBERS(ClassName)
Definition: RxObject.h:112
daiAttribute.h