adapt code for previous commits

This commit is contained in:
Thomas Krijnen
2021-07-29 14:54:51 +02:00
parent e529eeb540
commit d1fe1117be
26 changed files with 447 additions and 394 deletions
+13 -11
View File
@@ -36,6 +36,7 @@ public:
int operator()(const IfcWriteArgument::Derived& /*i*/) const { return -1; }
int operator()(const int& /*i*/) const { return -1; }
int operator()(const bool& /*i*/) const { return -1; }
int operator()(const boost::logic::tribool& /*i*/) const { return -1; }
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; }
@@ -49,8 +50,8 @@ public:
int operator()(const std::vector< boost::dynamic_bitset<> >& i) const { return (int)i.size(); }
int operator()(const IfcWriteArgument::EnumerationReference& /*i*/) const { return -1; }
int operator()(const IfcUtil::IfcBaseClass* const& /*i*/) const { return -1; }
int operator()(const IfcEntityList::ptr& i) const { return i->size(); }
int operator()(const IfcEntityListList::ptr& i) const { return i->size(); }
int operator()(const aggregate_of_instance::ptr& i) const { return i->size(); }
int operator()(const aggregate_of_aggregate_of_instance::ptr& i) const { return i->size(); }
};
class StringBuilderVisitor : public boost::static_visitor<void> {
@@ -120,6 +121,7 @@ public:
void operator()(const IfcWriteArgument::Derived& /*i*/) { data << "*"; }
void operator()(const int& i) { data << i; }
void operator()(const bool& i) { data << (i ? ".T." : ".F."); }
void operator()(const boost::logic::tribool& i) { data << (i ? ".T." : (boost::logic::indeterminate(i) ? ".U." : ".F.")); }
void operator()(const double& i) { data << format_double(i); }
void operator()(const boost::dynamic_bitset<>& i) { data << format_binary(i); }
void operator()(const std::string& i) {
@@ -145,9 +147,9 @@ public:
data << "#" << e.id();
}
}
void operator()(const IfcEntityList::ptr& i) {
void operator()(const aggregate_of_instance::ptr& i) {
data << "(";
for (IfcEntityList::it it = i->begin(); it != i->end(); ++it) {
for (aggregate_of_instance::it it = i->begin(); it != i->end(); ++it) {
if (it != i->begin()) data << ",";
(*this)(*it);
}
@@ -155,12 +157,12 @@ public:
}
void operator()(const std::vector< std::vector<int> >& i);
void operator()(const std::vector< std::vector<double> >& i);
void operator()(const IfcEntityListList::ptr& i) {
void operator()(const aggregate_of_aggregate_of_instance::ptr& i) {
data << "(";
for (IfcEntityListList::outer_it outer_it = i->begin(); outer_it != i->end(); ++outer_it) {
for (aggregate_of_aggregate_of_instance::outer_it outer_it = i->begin(); outer_it != i->end(); ++outer_it) {
if (outer_it != i->begin()) data << ",";
data << "(";
for (IfcEntityListList::inner_it inner_it = outer_it->begin(); inner_it != outer_it->end(); ++inner_it) {
for (aggregate_of_aggregate_of_instance::inner_it inner_it = outer_it->begin(); inner_it != outer_it->end(); ++inner_it) {
if (inner_it != outer_it->begin()) data << ",";
(*this)(*inner_it);
}
@@ -240,10 +242,10 @@ IfcWriteArgument::operator std::vector<double>() const { return as<std::vector<d
IfcWriteArgument::operator std::vector<int>() const { return as<std::vector<int> >(); }
IfcWriteArgument::operator std::vector<std::string>() const { return as<std::vector<std::string > >(); }
IfcWriteArgument::operator std::vector< boost::dynamic_bitset<> >() const { return as< std::vector< boost::dynamic_bitset<> > >(); }
IfcWriteArgument::operator IfcEntityList::ptr() const { return as<IfcEntityList::ptr>(); }
IfcWriteArgument::operator aggregate_of_instance::ptr() const { return as<aggregate_of_instance::ptr>(); }
IfcWriteArgument::operator std::vector< std::vector<int> >() const { return as<std::vector< std::vector<int> > >(); }
IfcWriteArgument::operator std::vector< std::vector<double> >() const { return as<std::vector< std::vector<double> > >(); }
IfcWriteArgument::operator IfcEntityListList::ptr() const { return as<IfcEntityListList::ptr>(); }
IfcWriteArgument::operator aggregate_of_aggregate_of_instance::ptr() const { return as<aggregate_of_aggregate_of_instance::ptr>(); }
bool IfcWriteArgument::isNull() const { return type() == IfcUtil::Argument_NULL; }
Argument* IfcWriteArgument::operator [] (unsigned int /*i*/) const { throw IfcParse::IfcException("Invalid cast"); }
std::string IfcWriteArgument::toString(bool upper) const {
@@ -268,7 +270,7 @@ IfcUtil::ArgumentType IfcWriteArgument::type() const {
}
// Overload to detect null values
void IfcWriteArgument::set(const IfcEntityList::ptr& v) {
void IfcWriteArgument::set(const aggregate_of_instance::ptr& v) {
if (v) {
container = v;
} else {
@@ -277,7 +279,7 @@ void IfcWriteArgument::set(const IfcEntityList::ptr& v) {
}
// Overload to detect null values
void IfcWriteArgument::set(const IfcEntityListList::ptr& v) {
void IfcWriteArgument::set(const aggregate_of_aggregate_of_instance::ptr& v) {
if (v) {
container = v;
} else {