X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBoxDescriptor.h;h=a680b54f81124bbcd195085ee69ec4ddedef4168;hb=c2a4b1893412e50a3d9abff221938a2d16c4a7cb;hp=6443d50ac93469b756cf5541393c54bf65de6c49;hpb=c03be5662c1ea498e612cbaa9f9b7a9988a65765;p=bbtk.git diff --git a/kernel/src/bbtkBlackBoxDescriptor.h b/kernel/src/bbtkBlackBoxDescriptor.h index 6443d50..a680b54 100644 --- a/kernel/src/bbtkBlackBoxDescriptor.h +++ b/kernel/src/bbtkBlackBoxDescriptor.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBoxDescriptor.h,v $ Language: C++ - Date: $Date: 2008/03/07 08:40:14 $ - Version: $Revision: 1.6 $ + Date: $Date: 2008/04/09 11:16:57 $ + Version: $Revision: 1.8 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -54,16 +54,16 @@ namespace bbtk /// The kinds of black box typedef enum { - STANDARD, - ADAPTOR, - DEFAULT_ADAPTOR + STANDARD=0, + ADAPTOR=1, + DEFAULT_ADAPTOR=2, + WIDGET_ADAPTOR=3, + DEFAULT_WIDGET_ADAPTOR=4 } Kind; /// Default ctor BlackBoxDescriptor(); - /// Default dtor - virtual ~BlackBoxDescriptor(); /// Creates an instance with name boxname of the BlackBox /// of which this is the descriptor virtual BlackBox* CreateInstance(const std::string& boxname) = 0; @@ -71,6 +71,9 @@ namespace bbtk /// Returns the name of the **TYPE** of the black box const std::string& GetTypeName() const { return mTypeName; } + /// Returns the full name of the **TYPE** of the black box (+package name) + std::string GetFullTypeName() const; + /// Returns the description of the BlackBox const std::string& GetDescription() const { return mDescription; } @@ -138,7 +141,18 @@ namespace bbtk const std::string& output_dir = "", bool relative_link = false ); + /// Increase ref count + void Reference() { mRefCount++; } + /// Decrease ref count and delete if no more used + void UnReference(); + + /// + virtual void Check(bool recursive=true) const; + protected: + /// Default dtor is protected : use UnRegister to destroy (ref counting) + virtual ~BlackBoxDescriptor(); + /// Adds an input descriptor void AddInputDescriptor( BlackBoxInputDescriptor *d ) { mInput[d->GetName()] = d; } @@ -163,7 +177,12 @@ namespace bbtk InputDescriptorMapType mInput; /// The outputs OutputDescriptorMapType mOutput; + + /// Reference counting + int mRefCount; + private: + BlackBoxDescriptor(const BlackBoxDescriptor&) {} }; // class BlackBoxDescriptor //==========================================================================