Task: Remove std::map inheritance, clean up interface
- Make the Task object's interface more explicit by removing the std::map inheritance. - Using this more explicit interface, remove unneeded ctors in order to allow the compiler to "Do The Right Thing"(tm). This leads to a performance improvement of 12% in the "add" performance test, and 7% for "import".
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
#include <time.h>
|
||||
#include <JSON.h>
|
||||
|
||||
class Task : public std::map <std::string, std::string>
|
||||
class Task
|
||||
{
|
||||
public:
|
||||
static std::string defaultProject;
|
||||
@@ -58,12 +58,11 @@ public:
|
||||
|
||||
public:
|
||||
Task (); // Default constructor
|
||||
Task (const Task&); // Copy constructor
|
||||
Task& operator= (const Task&); // Assignment operator
|
||||
bool operator== (const Task&); // Comparison operator
|
||||
Task (const std::string&); // Parse
|
||||
Task (const json::object*); // Parse
|
||||
~Task (); // Destructor
|
||||
|
||||
std::map <std::string, std::string> data;
|
||||
|
||||
void parse (const std::string&);
|
||||
std::string composeF4 () const;
|
||||
|
||||
Reference in New Issue
Block a user