diff options
-rw-r--r-- | src/CuTNetLib/cuComponent.h | 8 |
1 files changed, 7 insertions, 1 deletions
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); |