mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 20:22:09 +00:00
Performance improvement of IfcParse tokenizer (#82)
* Applied MSVC tabify to IfcParse.cpp/h. * Now Argument base class has throwing implementation for each conversion operator (removed those from derived classes). * Added NullArgument class for the case when null arguments appear after setting elements. * Now operator tokens are handled just like any other token. * Refactoring: Token is now a struct with good fields, not a nameless pair. * Now end position of token is set at its construction. * Now type of token is determined on construction, as* function simply check stored type. * Now int-s, float-s and some etc are parsed when token is created. * Implemented simple way to remove spaces in parsing. * Tokens are now created without allocations. * Call RemoveTokenSeparators once for every token. * Added temporary std::string object in lexer (for optimization purposes). * Reimplemented asString without allocations. * Parsing keywords without allocations. * Added checks for type to tokenFunc::as*** functions.
This commit is contained in:
committed by
Thomas Krijnen
parent
cbbdb61a0c
commit
8725c66306
+14
-14
@@ -283,22 +283,22 @@ namespace IfcParse {
|
||||
|
||||
class IfcParse_EXPORT Argument {
|
||||
public:
|
||||
virtual operator int() const = 0;
|
||||
virtual operator bool() const = 0;
|
||||
virtual operator double() const = 0;
|
||||
virtual operator std::string() const = 0;
|
||||
virtual operator boost::dynamic_bitset<>() const = 0;
|
||||
virtual operator IfcUtil::IfcBaseClass*() const = 0;
|
||||
virtual operator int() const;
|
||||
virtual operator bool() const;
|
||||
virtual operator double() const;
|
||||
virtual operator std::string() const;
|
||||
virtual operator boost::dynamic_bitset<>() const;
|
||||
virtual operator IfcUtil::IfcBaseClass*() const;
|
||||
|
||||
virtual operator std::vector<int>() const = 0;
|
||||
virtual operator std::vector<double>() const = 0;
|
||||
virtual operator std::vector<std::string>() const = 0;
|
||||
virtual operator std::vector<boost::dynamic_bitset<> >() const = 0;
|
||||
virtual operator IfcEntityList::ptr() const = 0;
|
||||
virtual operator std::vector<int>() const;
|
||||
virtual operator std::vector<double>() const;
|
||||
virtual operator std::vector<std::string>() const;
|
||||
virtual operator std::vector<boost::dynamic_bitset<> >() const;
|
||||
virtual operator IfcEntityList::ptr() const;
|
||||
|
||||
virtual operator std::vector< std::vector<int> >() const = 0;
|
||||
virtual operator std::vector< std::vector<double> >() const = 0;
|
||||
virtual operator IfcEntityListList::ptr() const = 0;
|
||||
virtual operator std::vector< std::vector<int> >() const;
|
||||
virtual operator std::vector< std::vector<double> >() const;
|
||||
virtual operator IfcEntityListList::ptr() const;
|
||||
|
||||
virtual bool isNull() const = 0;
|
||||
virtual unsigned int size() const = 0;
|
||||
|
||||
Reference in New Issue
Block a user