From ac7187b42fc1342c6432978f0628d5b7a137396d Mon Sep 17 00:00:00 2001 From: tkawata Date: Mon, 18 Jun 2012 00:38:30 +0900 Subject: [PATCH] refactored for next development phase (2) --- Source/TKAxon.h | 6 ++++-- Source/TKAxonTerminal.h | 2 ++ Source/TKContainer.h | 10 +++++----- Source/TKReceptor.h | 2 ++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Source/TKAxon.h b/Source/TKAxon.h index dffe3c1..a5e941c 100644 --- a/Source/TKAxon.h +++ b/Source/TKAxon.h @@ -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 mTerminals; + private: float mValue; TKCell *mOwner; - std::vector mTerminals; TKLock mLock; }; diff --git a/Source/TKAxonTerminal.h b/Source/TKAxonTerminal.h index c2de645..053810b 100644 --- a/Source/TKAxonTerminal.h +++ b/Source/TKAxonTerminal.h @@ -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); diff --git a/Source/TKContainer.h b/Source/TKContainer.h index bc2bb61..09e6480 100644 --- a/Source/TKContainer.h +++ b/Source/TKContainer.h @@ -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; diff --git a/Source/TKReceptor.h b/Source/TKReceptor.h index c01f970..939dfd1 100644 --- a/Source/TKReceptor.h +++ b/Source/TKReceptor.h @@ -27,6 +27,8 @@ class TKReceptor { public: TKReceptor(TKCell *theOwner) : mOwner(theOwner), mTerminal(0) {} + virtual ~TKReceptor() {} + void setTarget(TKAxonTerminal *theTerminal); float getValue(); -- 2.11.0