* Make arguments that were previously references (see
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 05:54:44 +0000 (07:54 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 05:54:44 +0000 (07:54 +0200)
 7e140e4a6676bed7583831251469fcee457f7654) now const references. GCC
 will allow temporary constructors to be converted to const references
 and that will do just fine.

ABM2/Engine/Kernel.cpp
ABM2/Engine/Kernel.h
ABM2/Engine/Settings.cpp
ABM2/Engine/Settings.h

index 42e112bc7f52653f576b32e758c8d68c9ebdcea1..12afa65230fd612f541dab224d80d41d0ce834bb 100755 (executable)
@@ -75,7 +75,7 @@ int CKernel::Execute()
        return 0;\r
 }\r
 \r
-bool CKernel::AddTask(CMMPointer<ITask> t)\r
+bool CKernel::AddTask(const CMMPointer<ITask> &t)\r
 {\r
        if(!t->Start())return false;\r
 \r
@@ -90,7 +90,7 @@ bool CKernel::AddTask(CMMPointer<ITask> t)
        return true;\r
 }\r
 \r
-void CKernel::SuspendTask(CMMPointer<ITask> t)\r
+void CKernel::SuspendTask(const CMMPointer<ITask> &t)\r
 {\r
        //check that this task is in our list - we don't want to suspend a task that isn't running\r
        if(std::find(taskList.begin(),taskList.end(),t)!=taskList.end())\r
@@ -101,7 +101,7 @@ void CKernel::SuspendTask(CMMPointer<ITask> t)
        }\r
 }\r
 \r
-void CKernel::ResumeTask(CMMPointer<ITask> t)\r
+void CKernel::ResumeTask(const CMMPointer<ITask> &t)\r
 {\r
        if(std::find(pausedTaskList.begin(),pausedTaskList.end(),t)!=pausedTaskList.end())\r
        {\r
@@ -118,7 +118,7 @@ void CKernel::ResumeTask(CMMPointer<ITask> t)
        }\r
 }\r
 \r
-void CKernel::RemoveTask(CMMPointer<ITask> t)\r
+void CKernel::RemoveTask(const CMMPointer<ITask> &t)\r
 {\r
        if(std::find(taskList.begin(),taskList.end(),t)!=taskList.end())\r
        {\r
index 60f6006c59fb1bc5dc2e603e6d7f6a9075845294..0e1c39d8a584fe9e4959925de89854aa97f4c9e9 100755 (executable)
@@ -25,10 +25,10 @@ public:
 \r
        int Execute();\r
 \r
-       bool AddTask(CMMPointer<ITask> t);\r
-       void SuspendTask(CMMPointer<ITask> t);\r
-       void ResumeTask(CMMPointer<ITask> t);\r
-       void RemoveTask(CMMPointer<ITask> t);\r
+       bool AddTask(const CMMPointer<ITask> &t);\r
+       void SuspendTask(const CMMPointer<ITask> &t);\r
+       void ResumeTask(const CMMPointer<ITask> &t);\r
+       void RemoveTask(const CMMPointer<ITask> &t);\r
        void KillAllTasks();\r
 \r
 protected:\r
index 0d74f3c5f8b46a1b8592b0c7ce1087f50e6fc712..48324c29fb0b14a8785eeef080c9f738ad67a026 100755 (executable)
@@ -20,7 +20,7 @@ CSettingsManager::~CSettingsManager()
        DestroyStandardSettings();\r
 }\r
 \r
-void CSettingsManager::RegisterVariable(std::string name, CMMPointer<BaseDator> var)\r
+void CSettingsManager::RegisterVariable(const std::string &name, const CMMPointer<BaseDator> &var)\r
 {\r
        settingMap[name]=var;\r
 }\r
index 8b6daf8941f98aabd0b662fb5e9a8314d7a68755..cb8d3aeea1dbff639b5315c3facab4d963738de8 100755 (executable)
@@ -18,7 +18,7 @@ public:
        CSettingsManager();\r
        virtual ~CSettingsManager();\r
 \r
-       void RegisterVariable(std::string name, CMMPointer<BaseDator> var);\r
+       void RegisterVariable(const std::string &name, const CMMPointer<BaseDator> &var);\r
        void SetVariable(std::string &name, std::string &value, int bias=0);\r
 \r
        void CreateStandardSettings();\r