1 #ifndef SDAIMODEL_CONTENTS_H 2 #define SDAIMODEL_CONTENTS_H 1 3 4 #include <sc_export.h> 5 //SDAI_Model_contents 6 7 /* 8 7.3.2 SDAI_Model_contents 9 */ 10 11 /* 12 //#include <sdaiDefs.h> 13 14 // for Application_instance__set 15 //#include <STEPentity.h> 16 //#include <ApplInstanceSet.h> 17 18 // for Entity_extent__set 19 //#include <EntityExtent.h> 20 //#include <EntityExtentSet.h> 21 22 // for supertype Session_instance 23 //#include <SessionInstance.h> 24 */ 25 26 // The class SDAI_Model_contents_instances shall implement convenience functions by 27 // SDAI_Model_contents in this part of ISO 10303 28 29 class SC_DAI_EXPORT SDAI_Model_contents_instances : public SDAI_DAObject { 30 public: 31 32 SDAI_DAObject__set _instances; 33 34 SDAI_Model_contents_instances(); 35 virtual ~SDAI_Model_contents_instances(); 36 37 // This function shall return the set of DAObjects contained in 38 // the receiver. contents_()39 SDAI_DAObject__set_var contents_() { 40 return &_instances; 41 } contents_()42 SDAI_DAObject__set_var contents_() const { 43 return ( const SDAI_DAObject__set_var ) &_instances; 44 } 45 46 }; 47 48 typedef SDAI_Model_contents_instances * 49 SDAI_Model_contents_instances_ptr; 50 typedef SDAI_Model_contents_instances_ptr 51 SDAI_Model_contents_instances_var; 52 53 // Model_contents_ptr def pushed ahead of #include for Entity_extent 54 55 class SC_DAI_EXPORT SDAI_Model_contents : public SDAI_Session_instance { 56 57 //friend class SDAI_Model; 58 59 /* 60 NOTE - Model is a friend so that Model may access the contents of 61 the Entity_extents folders. 62 63 DATA MEMBERS 64 */ 65 public: 66 SDAI_Model_contents_instances _instances; 67 68 SDAI_Entity_extent__set _folders; // of entity_extent 69 70 SDAI_Entity_extent__set _populated_folders; // of entity_extent 71 72 /* 73 Constructor declarations 74 */ 75 public: // for now at least 76 SDAI_Model_contents(); 77 ~SDAI_Model_contents(); 78 /* 79 Access function declarations 80 */ 81 public: 82 SDAI_Model_contents_instances_ptr instances_(); 83 SDAI_Model_contents_instances_ptr instances_() const; 84 85 SDAI_Entity_extent__set_var folders_(); 86 SDAI_Entity_extent__set_var folders_() const; 87 88 SDAI_Entity_extent__set_var populated_folders_() const; 89 SDAI_Entity_extent__set_var populated_folders_(); 90 91 SDAI_PID_DA_ptr 92 get_object_pid( const SDAI_DAObject_ptr & d ) const; 93 94 SDAI_DAObject_ptr lookup( const SDAI_PID_DA_ptr & p ) const; 95 96 /* 97 SDAI operation declarations 98 99 7.3.2.1 SDAI operation declarations 100 101 7.3.2.1.1 Add instance 102 */ 103 // private: 104 public: // for now at least 105 SDAI_DAObject_ptr 106 CreateEntityInstance( const char * Type ); 107 108 // until we find out what this should really be in the spec 109 void AddInstance( const SDAI_DAObject_SDAI_ptr & appInst ); 110 // void AddInstance(const Entity_instance_ptr& entityHandle); 111 //void AddInstance(EntityInstanceH& entityHandle); 112 /* Function: 113 The AddInstance function shall add the entity instance entity handle 114 to the instances set of the receiver. This function shall add the 115 entity instance entityHandle to each Entity_extent in the folders 116 attribute of the receiver for which the type or a subtype of the 117 type contained in the folder corresponds to the type of entityHandle. 118 This function shall add the entity instance entityHandle to each 119 Entity_extent in the populated_folders attribute of the receiver for 120 which the type or a subtype of the type contained in the folder 121 corresponds to the type of entityHandle. 122 123 Possible error indicators: 124 sdaiSS_NOPN // Session not open 125 sdaiRP_NOPN // Repository not open 126 sdaiMO_NEXS // SDAI-model does not exist 127 sdaiMX_NRW // SDAI-model access not read-write 128 sdaiSY_ERR // Underlying system error 129 130 Origin: Convenience function 131 */ 132 133 // until we find out what this should really be in the spec 134 void RemoveInstance( SDAI_DAObject_SDAI_ptr & appInst ); 135 // void RemoveInstance(Entity_instance_ptr& entityHandle); 136 //void RemoveInstance(EntityInstanceH& entityHandle); 137 /* Function 138 The RemoveInstance function shall remove the entity instance entity 139 handle from the instances set of the receiver. This function shall 140 remove the entity instance entityHandle from each Entity_extent in 141 the folders attribute of the receiver for which the type or a 142 subtype of the type contained in the folder corresponds to the 143 type of entityHandle. This function shall remove the entity 144 instance entityHandle from each Entity_extent in the 145 populated_folders attribute of the receiver for which the type or 146 a subtype of the type contained in the folder corresponds to the 147 type of entityHandle. 148 149 Possible error indicators 150 sdaiSS_NOPN // Session not open 151 sdaiRP_NOPN // Repository not open 152 sdaiMO_NEXS // SDAI-model does not exist 153 sdaiMX_NRW // SDAI-model access not read-write 154 sdaiSY_ERR // Underlying system error 155 156 Origin: Convenience function 157 */ 158 public: 159 160 /* 161 7.3.2.1.3 Get entity extent 162 */ 163 #ifdef SDAI_CPP_LATE_BINDING 164 #if 0 // for now 165 Any_var GetEntity_extent( const std::string & entityName ); 166 const Any_var GetEntity_extent( const std::string & entityName ) const; 167 Any_var GetEntity_extent( const Entity_ptr & ep ); 168 const Any_var GetEntity_extent( const Entity_ptr & ep ) const; 169 #endif 170 /* Function: 171 The GetEntity_extent function shall retrieve an entity folder from 172 the folders attribute within the contents attribute of the receiver. 173 This folder shall contain all of the instances of a particular type 174 and its subtypes within the model. The type may be specified 175 indirectly by the entityName parameter or directly by the entity. 176 Subsequent access to the returned aggregate shall be restricted to 177 read-only functionality. 178 179 Output: 180 This function shall return an aggregate handle used as an argument 181 for subsequent SDAI function calls. Otherwise, this function shall 182 return a null handle. 183 184 Possible error indicators: 185 sdaiSS_NOPN // Session not open 186 sdaiRP_NOPN // Repository not open 187 sdaiMO_NEXS // SDAI-model does not exist 188 sdaiED_NDEF // Entity definition unknown in this model 189 sdaiSY_ERR // Underlying system error 190 191 Origin: Convenience function 192 */ 193 194 #endif 195 196 }; 197 198 #endif 199