@@ -629,9 +629,10 @@ TokenArgument::TokenArgument(const Token& t) {
629629EntityArgument::EntityArgument (const Token& t) {
630630 IfcParse::IfcFile* file = t.lexer ->file ;
631631 IfcEntityInstanceData* data = read (0 , file, t.startPos );
632+ // Data needs to be loaded, for the tokens
633+ // to be consumed and parsing to continue.
634+ data->load ();
632635 entity = IfcSchema::SchemaEntity (data);
633- // Needs to be loaded, for the tokens to be consumed
634- file->load (*data);
635636}
636637
637638//
@@ -920,7 +921,7 @@ void IfcParse::IfcFile::register_inverse(unsigned id_from, Token t) {
920921//
921922std::string IfcEntityInstanceData::toString (bool upper) const {
922923 if (!initialized_) {
923- load_ ();
924+ load ();
924925 }
925926
926927 std::stringstream ss;
@@ -979,7 +980,7 @@ IfcFile::IfcFile()
979980 setDefaultHeaderValues ();
980981}
981982
982- void IfcEntityInstanceData::load_ () const {
983+ void IfcEntityInstanceData::load () const {
983984 file->load (*this );
984985 initialized_ = true ;
985986}
@@ -998,7 +999,7 @@ IfcEntityInstanceData::IfcEntityInstanceData(const IfcEntityInstanceData& e) {
998999
9991000Argument* IfcEntityInstanceData::getArgument (unsigned int i) const {
10001001 if (!initialized_) {
1001- load_ ();
1002+ load ();
10021003 }
10031004 if (i < attributes_.size ()) {
10041005 return attributes_[i];
@@ -1009,7 +1010,7 @@ Argument* IfcEntityInstanceData::getArgument(unsigned int i) const {
10091010
10101011void IfcEntityInstanceData::setArgument (unsigned int i, Argument* a, IfcUtil::ArgumentType attr_type) {
10111012 if (!initialized_) {
1012- load_ ();
1013+ load ();
10131014 }
10141015
10151016 while (attributes_.size () < i) {
0 commit comments