diff --git a/src/ifcparse/IfcWrite.cpp b/src/ifcparse/IfcWrite.cpp index 3d863f0c36..285fe34fdb 100644 --- a/src/ifcparse/IfcWrite.cpp +++ b/src/ifcparse/IfcWrite.cpp @@ -308,6 +308,8 @@ public: int operator()(const double& /*i*/) const { return -1; } int operator()(const std::string& /*i*/) const { return -1; } int operator()(const boost::dynamic_bitset<>& /*i*/) const { return -1; } + int operator()(const IfcWriteArgument::empty_aggregate_t&) const { return 0; } + int operator()(const IfcWriteArgument::empty_aggregate_of_aggregate_t&) const { return 0; } int operator()(const std::vector& i) const { return (int)i.size(); } int operator()(const std::vector& i) const { return (int)i.size(); } int operator()(const std::vector< std::vector >& i) const { return (int)i.size(); } @@ -435,6 +437,8 @@ public: } data << ")"; } + void operator()(const IfcWriteArgument::empty_aggregate_t&) const { data << "()"; } + void operator()(const IfcWriteArgument::empty_aggregate_of_aggregate_t&) const { data << "()"; } operator std::string() { return data.str(); } }; diff --git a/src/ifcparse/IfcWrite.h b/src/ifcparse/IfcWrite.h index 04a7c6d89f..2d9457474d 100644 --- a/src/ifcparse/IfcWrite.h +++ b/src/ifcparse/IfcWrite.h @@ -54,6 +54,8 @@ namespace IfcWrite { : data(data), enumeration_value(enumeration_value) {} }; class Derived {}; + class empty_aggregate_t {}; + class empty_aggregate_of_aggregate_t {}; private: boost::variant< // A null argument, it will always serialize to $ @@ -85,6 +87,7 @@ namespace IfcWrite { IfcUtil::IfcBaseClass*, // AGGREGATES: + empty_aggregate_t, // An aggregate of integers, e.g. (1,2,3) std::vector, // An aggregate of floats, e.g. (12.3,4.) @@ -99,6 +102,7 @@ namespace IfcWrite { IfcEntityList::ptr, // AGGREGATES OF AGGREGATES: + empty_aggregate_of_aggregate_t, // An aggregate of an aggregate of ints. E.g. ((1, 2), (3)) std::vector< std::vector >, // An aggregate of an aggregate of floats. E.g. ((1., 2.3), (4.))