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
/// 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;
/// 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; }
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; }
InputDescriptorMapType mInput;
/// The outputs
OutputDescriptorMapType mOutput;
+
+ /// Reference counting
+ int mRefCount;
+ private:
+ BlackBoxDescriptor(const BlackBoxDescriptor&) {}
};
// class BlackBoxDescriptor
//==========================================================================