From 5bca76a9e78e7e77779398501b4d233a2b58d26b Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Mon, 6 Oct 2014 21:54:53 +0800 Subject: Virtual 9++++++ --- src/CuTNetLib/cuComponent.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CuTNetLib/cuComponent.h b/src/CuTNetLib/cuComponent.h index a43680e..19908de 100644 --- a/src/CuTNetLib/cuComponent.h +++ b/src/CuTNetLib/cuComponent.h @@ -45,7 +45,11 @@ namespace TNet { */ class CuComponent { + private: + static int UID_CNT=0; public: + /// Unique id of this component + int UID; /// Types of the net components typedef enum { UPDATABLE_COMPONENT = 0x0100, @@ -281,7 +285,9 @@ namespace TNet { : mNInputs(nInputs), mNOutputs(nOutputs), mpInput(NULL), mpErrorInput(NULL), mOutput(), mErrorOutput(),preComp(pPred) - { + { + UID=++UID_CNT; + /* DOUBLE LINK the Components */ if (pPred != NULL) { SetPrevious(pPred); -- cgit v1.2.3-70-g09d2