IfcParse dynamic linking, IFCPARSE_NO_REGEX, fixes for three memory leaks (#76)

* CMake: moved setting link directories before all the projects.

* Added IfcParse_Export header for declaring export macro.

* Added IFCPARSE_STATIC_DEFINE macro to all projects.

* Added include for export macro to swig file.

* Added IfcParse_EXPORT macro for all classes in headers generated by express parser.

* Allow removing boost.regex dependency by defining macro IFCPARSE_NO_REGEX.

* Fixed bug in deletion of ICU converter.

* Added export macro to most of the classes across headers

* Fixed memory leak: delete nested IfcAbstractEntity in EntityArgument.

* Fixed memory leak in destructor of IfcWritableEntity (args values).
This commit is contained in:
stgatilov
2016-05-29 18:12:57 +06:00
committed by Thomas Krijnen
parent a298903fdd
commit b5c4eb3b6f
22 changed files with 1784 additions and 1718 deletions
+9 -7
View File
@@ -40,6 +40,8 @@
#include <boost/shared_ptr.hpp>
#include <boost/dynamic_bitset.hpp>
#include "../ifcparse/IfcParse_Export.h"
#include "../ifcparse/IfcCharacterDecoder.h"
#include "../ifcparse/IfcUtil.h"
#include "../ifcparse/IfcLogger.h"
@@ -62,7 +64,7 @@ namespace IfcParse {
/// Provides functions to convert Tokens to binary data
/// Tokens are merely offsets to where they can be read in the file
class TokenFunc {
class IfcParse_EXPORT TokenFunc {
private:
static bool startsWith(const Token& t, char c);
public:
@@ -109,7 +111,7 @@ namespace IfcParse {
Token TokenPtr();
/// A stream of tokens to be read from a IfcSpfStream.
class IfcSpfLexer {
class IfcParse_EXPORT IfcSpfLexer {
private:
IfcCharacterDecoder* decoder;
unsigned int skipWhitespace();
@@ -126,7 +128,7 @@ namespace IfcParse {
/// Argument of type list, e.g.
/// #1=IfcDirection((1.,0.,0.));
/// ==========
class ArgumentList: public Argument {
class IfcParse_EXPORT ArgumentList: public Argument {
private:
std::vector<Argument*> list;
void push(Argument* l);
@@ -166,7 +168,7 @@ namespace IfcParse {
/// Argument of type scalar or string, e.g.
/// #1=IfcVector(#2,1.0);
/// == ===
class TokenArgument : public Argument {
class IfcParse_EXPORT TokenArgument : public Argument {
private:
public:
@@ -202,7 +204,7 @@ namespace IfcParse {
/// Argument of an IFC simple type
/// #1=IfcTrimmedCurve(#2,(IFCPARAMETERVALUE(0.)),(IFCPARAMETERVALUE(1.)),.T.,.PARAMETER.);
/// ===================== =====================
class EntityArgument : public Argument {
class IfcParse_EXPORT EntityArgument : public Argument {
private:
IfcUtil::IfcBaseClass* entity;
public:
@@ -238,7 +240,7 @@ namespace IfcParse {
/// Entity defined in an IFC file, e.g.
/// #1=IfcDirection((1.,0.,0.));
/// ============================
class Entity : public IfcAbstractEntity {
class IfcParse_EXPORT Entity : public IfcAbstractEntity {
private:
mutable ArgumentList* args;
mutable IfcSchema::Type::Enum _type;
@@ -264,6 +266,6 @@ namespace IfcParse {
}
std::ostream& operator<< (std::ostream& os, const IfcParse::IfcFile& f);
IfcParse_EXPORT std::ostream& operator<< (std::ostream& os, const IfcParse::IfcFile& f);
#endif