From 7a974b89a3d887a70c1f62aab943107514e89f0c Mon Sep 17 00:00:00 2001
From: Mansard <nmansard@laas.fr>
Date: Tue, 21 Jun 2011 14:27:54 +0200
Subject: [PATCH] Pass the getclassName to pure virtual.

---
 include/dynamic-graph/entity.h | 5 +----
 src/dgraph/entity.cpp          | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/include/dynamic-graph/entity.h b/include/dynamic-graph/entity.h
index b102178..267a7fc 100644
--- a/include/dynamic-graph/entity.h
+++ b/include/dynamic-graph/entity.h
@@ -60,10 +60,7 @@ namespace dynamicgraph
       return name;
     }
 
-    virtual const std::string& getClassName  () const
-    {
-      return CLASS_NAME;
-    }
+    virtual const std::string& getClassName  () const = 0;
 
     SignalBase<int>& getSignal (const std::string& signalName);
     const SignalBase<int>& getSignal (const std::string& signalName) const;
diff --git a/src/dgraph/entity.cpp b/src/dgraph/entity.cpp
index b71ba72..0b5c5db 100644
--- a/src/dgraph/entity.cpp
+++ b/src/dgraph/entity.cpp
@@ -59,7 +59,7 @@ Entity( const string& name__ )
   if( name.length ()==0 )
     {
       stringstream oss; oss << rand ();
-      name = this->getClassName();
+      //name = this->getClassName(); Cannot call a virtual function from the constructor
       name+="::";
       name+=oss.str ();
     }
-- 
GitLab