OSDN Git Service

refactored for next development phase (2)
authortkawata <tkawata@users.sourceforge.jp>
Sun, 17 Jun 2012 15:38:30 +0000 (00:38 +0900)
committertkawata <tkawata@users.sourceforge.jp>
Sun, 17 Jun 2012 15:38:30 +0000 (00:38 +0900)
Source/TKAxon.h
Source/TKAxonTerminal.h
Source/TKContainer.h
Source/TKReceptor.h

index dffe3c1..a5e941c 100644 (file)
@@ -32,16 +32,18 @@ class TKAxon
 {
 public:
        TKAxon(TKCell *theOwner);
-       ~TKAxon();
+    virtual ~TKAxon();
        TKAxonTerminal* addTerminal();
     TKCell*         getOwner() { return mOwner; }
     float           getValue();
     void            setValue(float value);
 
+protected:
+    std::vector<TKAxonTerminal*> mTerminals;
+
 private:
     float  mValue;
     TKCell *mOwner;
-    std::vector<TKAxonTerminal*> mTerminals;
     TKLock mLock;
 };
 
index c2de645..053810b 100644 (file)
@@ -27,6 +27,8 @@ class TKAxonTerminal
 {
 public:
        TKAxonTerminal(TKAxon *theOwner) : mOwner(theOwner), mTarget(0) {}
+    virtual ~TKAxonTerminal() {}
+
        void    setTarget(TKReceptor *theReceptor) {mTarget = theReceptor;}
     void    release(TKReceptor *receptor);
     
index bc2bb61..09e6480 100644 (file)
@@ -64,12 +64,12 @@ public:
     bool        doTick(float time);
     bool        doDestroy();
 
-    TKCell*     addCell(std::string theLocation, std::string theName, std::string type, std::string customScript);
-    TKCell*     addCell(std::string theLocation, std::string theName, TKCellCode *cellCode, std::string customScript);
-    TKCellCode* addCellCode(std::string theName, std::string theAPIType, std::string code);
+    virtual TKCell*         addCell(std::string theLocation, std::string theName, std::string type, std::string customScript);
+    virtual TKCell*         addCell(std::string theLocation, std::string theName, TKCellCode *cellCode, std::string customScript);
+    virtual TKCellCode*     addCellCode(std::string theName, std::string theAPIType, std::string code);
 
-    virtual void setValue(std::string key, float value) = 0;
-    inline virtual float getValue(std::string key) = 0;
+    virtual void            setValue(std::string key, float value) = 0;
+    inline virtual float    getValue(std::string key) = 0;
 
     virtual TKCell*         cellFactory(std::string location, std::string name, std::string type, bool canInterface = true) = 0;
     virtual TKAxon*         axonFactory(TKCell *theOwner) = 0;
index c01f970..939dfd1 100644 (file)
@@ -27,6 +27,8 @@ class TKReceptor
 {
 public:
        TKReceptor(TKCell *theOwner) : mOwner(theOwner), mTerminal(0) {}
+    virtual ~TKReceptor() {}
+
        void        setTarget(TKAxonTerminal *theTerminal);
     float       getValue();