From 6f678e6883d4d2734c81492412903c701c8e1f3c Mon Sep 17 00:00:00 2001 From: guigues Date: Thu, 7 Feb 2008 11:06:37 +0000 Subject: [PATCH] *** empty log message *** --- kernel/src/bbtkAtomicBlackBox.cxx | 242 +++++++ kernel/src/bbtkAtomicBlackBox.h | 143 ++++ kernel/src/bbtkAtomicBlackBoxDescriptor.h | 78 ++ kernel/src/bbtkAtomicBlackBoxGetSetFunctor.h | 268 +++++++ .../src/bbtkAtomicBlackBoxInputDescriptor.cxx | 60 ++ .../src/bbtkAtomicBlackBoxInputDescriptor.h | 83 +++ kernel/src/bbtkAtomicBlackBoxMacros.h | 683 ++++++++++++++++++ .../bbtkAtomicBlackBoxOutputDescriptor.cxx | 57 ++ .../src/bbtkAtomicBlackBoxOutputDescriptor.h | 78 ++ kernel/src/bbtkBlackBoxDescriptor.cxx | 11 +- kernel/src/bbtkComplexBlackBoxDescriptor.cxx | 12 +- kernel/src/bbtkRTTI.h | 61 +- 12 files changed, 1734 insertions(+), 42 deletions(-) create mode 100644 kernel/src/bbtkAtomicBlackBox.cxx create mode 100644 kernel/src/bbtkAtomicBlackBox.h create mode 100644 kernel/src/bbtkAtomicBlackBoxDescriptor.h create mode 100644 kernel/src/bbtkAtomicBlackBoxGetSetFunctor.h create mode 100644 kernel/src/bbtkAtomicBlackBoxInputDescriptor.cxx create mode 100644 kernel/src/bbtkAtomicBlackBoxInputDescriptor.h create mode 100644 kernel/src/bbtkAtomicBlackBoxMacros.h create mode 100644 kernel/src/bbtkAtomicBlackBoxOutputDescriptor.cxx create mode 100644 kernel/src/bbtkAtomicBlackBoxOutputDescriptor.h diff --git a/kernel/src/bbtkAtomicBlackBox.cxx b/kernel/src/bbtkAtomicBlackBox.cxx new file mode 100644 index 0000000..6b8d402 --- /dev/null +++ b/kernel/src/bbtkAtomicBlackBox.cxx @@ -0,0 +1,242 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbtkAtomicBlackBox.cxx,v $ + Language: C++ + Date: $Date: 2008/02/07 11:06:37 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +/** + * \file + * \brief class bbtk::AtomicBlackBox : abstract user defined black boxes + */ +#include "bbtkAtomicBlackBox.h" + +namespace bbtk +{ + + //========================================================================= + AtomicBlackBox::AtomicBlackBox(const std::string &name, bool alloc) + : BlackBox(name) + { + bbtkDebugMessageInc("Kernel",7, + "AtomicBlackBox::AtomicBlackBox(\"" + < AtomicBlackBox::bbBackwardUpdate() [" + <GetOutputDescriptor(name))->GetGetFunctor()->Get(this); + + bbtkDebugDecTab("Data",7); + return p; + } + //========================================================================= + + + //========================================================================= + /// Gets the input Data of a given name + Data AtomicBlackBox::bbGetInput( const std::string &name ) + { + bbtkDebugMessageInc("Data",7, + "AtomicBlackBox::bbGetInput(\""<GetInputDescriptor(name))->GetGetFunctor()->Get(this); + + bbtkDebugDecTab("Data",7); + return p; + } + //========================================================================= + + + //========================================================================= + /// Sets the data of the output called + void AtomicBlackBox::bbSetOutput( const std::string &name, Data data) + { + bbtkDebugMessageInc("Data",7, + "AtomicBlackBox::bbSetOutput(\""<GetOutputDescriptor(name))->GetSetFunctor()->Set(this,data); + + bbtkDebugDecTab("Data",7); + } + //========================================================================= + + + //========================================================================= + /// Sets the data of the input called + void AtomicBlackBox::bbSetInput( const std::string &name, Data data, + bool setModified ) + { + bbtkDebugMessageInc("Data",7, + "AtomicBlackBox::bbSetInput(\""<GetInputDescriptor(name))->GetSetFunctor()->Set(this,data); + + if (setModified) + { + bbSetModifiedStatus(); + } + + bbtkDebugDecTab("Data",7); + } + //========================================================================= + + //========================================================================= + /// Sets the data of the input called + void AtomicBlackBox::bbBruteForceSetInputPointer( const std::string &name, + void* data, + bool setModified ) + { + bbtkDebugMessageInc("Data",7, + "AtomicBlackBox::bbBruteForceSetInputPointer(\"" + <GetInputDescriptor(name))->GetSetFunctor()->BruteForceSetPointer(this,data); + + if (setModified) + { + bbSetModifiedStatus(); + } + + bbtkDebugDecTab("Data",7); + } + //========================================================================= + +} +// EO namespace bbtk diff --git a/kernel/src/bbtkAtomicBlackBox.h b/kernel/src/bbtkAtomicBlackBox.h new file mode 100644 index 0000000..a0102bb --- /dev/null +++ b/kernel/src/bbtkAtomicBlackBox.h @@ -0,0 +1,143 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbtkAtomicBlackBox.h,v $ + Language: C++ + Date: $Date: 2008/02/07 11:06:37 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +/** + * \file + * \brief class bbtk::AtomicBlackBox : ancestor of all user defined (concrete) black boxes which are atomic (vs. complex boxes which are made up of other (atomic or complex) boxes). + */ + +/** + * \class bbtk::AtomicBlackBox + * \brief Ancestor of all user defined (concrete) black boxes which are atomic (vs. complex boxes which are made up of other (atomic or complex) boxes). + */ + +#ifndef __bbtkAtomicBlackBox_h__ +#define __bbtkAtomicBlackBox_h__ + +#include "bbtkBlackBox.h" +#include "bbtkAtomicBlackBoxDescriptor.h" + +namespace bbtk +{ + + + //================================================================== + class BBTK_EXPORT AtomicBlackBox : public bbtk::BlackBox + { + //================================================================== + public: + //================================================================== + /// Gets the output Data of a given label + Data bbGetOutput( const std::string &label ); + /// Gets the input Data of a given label + Data bbGetInput( const std::string &label ); + /// Sets the data of the output called + void bbSetOutput( const std::string &name, Data data); + /// Sets the data of the input called + void bbSetInput( const std::string &name, Data data, + bool setModified = true); + /// Sets the data of the input called + void bbBruteForceSetInputPointer( const std::string &name, + void* data, + bool setModified = true); + //================================================================== + + //================================================================== + /// Destructor + virtual ~AtomicBlackBox(); + //================================================================== + + //================================================================== + protected: + //================================================================== + /// Constructor with the AtomicBlackBox's instance name + AtomicBlackBox(const std::string &name, bool alloc = true); + /// Constructor from an existing box (copy) with a new instance name + AtomicBlackBox(AtomicBlackBox& from, const std::string &name, + bool alloc = true); + //================================================================== + + public: + //================================================================== + /// Recursive pipeline processing in backward direction + /// (recursion is in backward direction however execution always goes forward). + /// + /// \returns The final status of the box (UPTODATE or MODIFIED) + /// + /// First checks that re-processing is needed (either Status==MODIFIED or InputProcessMode==Always) + /// then : + /// - updates its inputs by calling bbUpdateInputs (which recursively calls bbBackwardUpdate on amont boxes) + /// - calls bbProcess which here simply calls the user callback bbUserProcess which does the actual processing. + /// bbProcess is overloaded in WxBlackBox to handle widget creation and show + IOStatus bbBackwardUpdate(Connection* caller); + //================================================================== + + //================================================================== + protected: + //================================================================== + /// Calls the user defined processing method. + /// Overloaded in WxBlackBox to handle widget creation and show + virtual void bbProcess() { this->bbUserProcess(); } + //================================================================== + + //================================================================== + /// User callback which computes the outputs as a function of the inputs. + /// It is assumed to be deterministic and thus is only called is the inputs have changed + /// (i.e. if the black box is marked as modified) + virtual void bbUserProcess() + { + bbtkWarning("AtomicBlackBox::bbUserProcess() not overloaded for box '" + <(&BlackBox::bbGetInputBoxProcessMode), + new bbtk::AtomicBlackBoxTSetFunctor(&BlackBox::bbSetInputBoxProcessMode) ) ); + // Creates the input 'BoxExecute' + AddInputDescriptor + (new + bbtk::AtomicBlackBoxInputDescriptor + (typeid(AtomicBlackBoxDescriptor), + "BoxExecute", + "Any signal received by this input executes the box", + new bbtk::AtomicBlackBoxTGetFunctor(&BlackBox::bbGetInputBoxExecute), + new bbtk::AtomicBlackBoxTSetFunctor(&BlackBox::bbSetInputBoxExecute) ) ); + // Creates the output 'BoxChange' + AddOutputDescriptor + (new + bbtk::AtomicBlackBoxOutputDescriptor + (typeid(AtomicBlackBoxDescriptor), + "BoxChange", + "Signal modifications of the box", + new bbtk::AtomicBlackBoxTGetFunctor(&BlackBox::bbGetOutputBoxChange), + new bbtk::AtomicBlackBoxTSetFunctor(&BlackBox::bbSetOutputBoxChange) ) ); + // + AddToCategory("atomic box"); + } + }; + +} +// namespace bbtk +#endif diff --git a/kernel/src/bbtkAtomicBlackBoxGetSetFunctor.h b/kernel/src/bbtkAtomicBlackBoxGetSetFunctor.h new file mode 100644 index 0000000..e67b76f --- /dev/null +++ b/kernel/src/bbtkAtomicBlackBoxGetSetFunctor.h @@ -0,0 +1,268 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbtkAtomicBlackBoxGetSetFunctor.h,v $ + Language: C++ + Date: $Date: 2008/02/07 11:06:37 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +/** + * \file + * \brief Class bbtk::AtomicBlackBoxGetFunctor / Class bbtk::AtomicBlackBoxSetFunctor : abstract functors of the Get and Set accessors of the inputs and outputs of a AtomicBlackBox ; Concrete derivatives. + */ + +/** + * \class bbtk::AtomicBlackBoxGetFunctor + * \brief Abstract functor of the Get accessors of the inputs and outputs of a AtomicBlackBox + * \class bbtk::AtomicBlackBoxSetFunctor + * \brief Abstract functor of the Set accessors of the inputs and outputs of a AtomicBlackBox + * \class bbtk::AtomicBlackBoxTGetFunctor + * \brief Template for concrete functors of the Get accessors of the inputs and outputs of a AtomicBlackBox (inherits from bbtk::AtomicBlackBoxGetFunctor). + * \class bbtk::AtomicBlackBoxTSetFunctor + * \brief Template for concrete functors of the Set accessors of the inputs and outputs of a AtomicBlackBox (inherits from bbtk::AtomicBlackBoxSetFunctor). + */ + +#ifndef __bbtkAtomicBlackBoxGetSetFunctor_h__ +#define __bbtkAtomicBlackBoxGetSetFunctor_h__ + +#include "bbtkData.h" +#include "bbtkMessageManager.h" + +namespace bbtk +{ + + // Forward declaration + class AtomicBlackBox; + + + //=========================================================================== + class BBTK_EXPORT AtomicBlackBoxGetFunctor + { + public: + /// Default constructor + AtomicBlackBoxGetFunctor() {} + /// Abstract method which applies the "Get" function of AtomicBlackBox o + virtual Data Get(AtomicBlackBox* o) = 0; + /// + virtual TypeInfo GetTypeInfo() const = 0; + /// + virtual std::string GetTypeName() const = 0; + /// + virtual std::string GetHumanTypeName() const = 0; + /// + virtual bool IsPointerType() const = 0; + + }; + //=========================================================================== + + + //=========================================================================== + class AtomicBlackBoxSetFunctor + { + public: + /// Default constructor + AtomicBlackBoxSetFunctor() {} + /// Abstract method which applies the "Set" function of AtomicBlackBox o + virtual void Set(AtomicBlackBox* o, const Data&) = 0; + /// + virtual TypeInfo GetTypeInfo() const = 0; + /// + virtual std::string GetTypeName() const = 0; + /// + virtual std::string GetHumanTypeName() const = 0; + /// + virtual bool IsPointerType() const = 0; + /// Abstract method which applies the "Set" function of AtomicBlackBox o + /// using brute force cast to the typed pointer required by the "Set" fun. + /// Only works if the param type of the "Set" function is a pointer + /// (see template specialization below). + /// !!! Use with care !!! + virtual void BruteForceSetPointer(AtomicBlackBox* o, void* p) = 0; + + }; + //=========================================================================== + + + + //=========================================================================== + template + class AtomicBlackBoxTGetFunctor : public bbtk::AtomicBlackBoxGetFunctor + { + public: + /// Type of pointer on a UBB::Get method + typedef TRETURN (UBB::*GetMethodPointerType)(void); //const + + /// Construction with the pointer on the Get method + AtomicBlackBoxTGetFunctor(GetMethodPointerType g) : + mGetMethodPointer(g) + { + bbtkDebugMessage("Data",9,"AtomicBlackBoxTGetFunctor<"<< + TypeName()<<","<< + TypeName()<<","<< + TypeName()<< + ">::AtomicBlackBoxTGetFunctor()"<()<<","<< + TypeName()<<","<< + TypeName()<< + ">::Get()"<*mGetMethodPointer)(); + } + /// + TypeInfo GetTypeInfo() const { return typeid(T); } + std::string GetTypeName() const { return TypeName(); } + std::string GetHumanTypeName() const { return HumanTypeName(); } + /// + virtual bool IsPointerType() const + { +#ifdef _USE_BOOST_ + return boost::is_pointer::value; +#else + return false; +#endif + } + + private: + /// Pointer on the Get method + GetMethodPointerType mGetMethodPointer; + }; + //=========================================================================== + + + + //=========================================================================== + template + class AtomicBlackBoxTSetFunctor : public AtomicBlackBoxSetFunctor + { + public: + /// Type of pointer on a UBB::Set method + typedef void (UBB::*SetMethodPointerType)(TACCESS); + + /// Construction with the pointer on the Set method + AtomicBlackBoxTSetFunctor(SetMethodPointerType s) : + mSetMethodPointer(s) + { + bbtkDebugMessage("Data",9,"AtomicBlackBoxTSetFunctor<"<< + TypeName()<<","<< + TypeName()<<","<< + TypeName()<< + ">::AtomicBlackBoxTSetFunctor()"<()<<","<< + TypeName()<<","<< + TypeName()<< + ">::Set()"<*mSetMethodPointer)(*(T*)d); + // bbtkAssert( bbtkEqualTypes( d.type(), typeid(T) ) ); + T t = d.unsafe_get(); + (((UBB*)o)->*mSetMethodPointer)(t); + // bbtkDebugMessage("Kernel",9,"SetOK"<(); } + std::string GetHumanTypeName() const { return HumanTypeName(); } + virtual bool IsPointerType() const { return false; } + virtual void BruteForceSetPointer(AtomicBlackBox* b, void* p) + { + bbtkInternalError("AtomicBlackBoxTSetFunctor<" + <()<<"," + <()<<"," + <() + <<">::BruteForceSetPointer(" + <() + <<"' is not a pointer type"); + } + private: + /// Pointer on the Set method + SetMethodPointerType mSetMethodPointer; + }; + //=========================================================================== + + + + //=========================================================================== + /// Template specialization of AtomicBlackBoxTSetFunctor for pointer types + template + class AtomicBlackBoxTSetFunctor + : public AtomicBlackBoxSetFunctor + { + public: + /// Type of pointer on a UBB::Set method + typedef void (UBB::*SetMethodPointerType)(TACCESS*); + + /// Construction with the pointer on the Set method + AtomicBlackBoxTSetFunctor(SetMethodPointerType s) : + mSetMethodPointer(s) + { + bbtkDebugMessage("Data",9,"AtomicBlackBoxTSetFunctor<"<< + TypeName()<<","<< + TypeName()<<","<< + TypeName()<< + ">::AtomicBlackBoxTSetFunctor()"<()<<","<< + TypeName()<<","<< + TypeName()<< + ">::Set()"<*mSetMethodPointer)(d.unsafe_get()); + + } + + /// + TypeInfo GetTypeInfo() const { return typeid(T*); } + std::string GetTypeName() const { return TypeName(); } + std::string GetHumanTypeName() const { return HumanTypeName(); } + virtual bool IsPointerType() const { return true; } + + + virtual void BruteForceSetPointer(AtomicBlackBox* o, void* p) + { + bbtkDebugMessage("Data",9,"AtomicBlackBoxTSetFunctor<" + <()<<"," + <()<<"," + <() + <<">::BruteForceSetPointer() (pointer specialization)"); + + (((UBB*)o)->*mSetMethodPointer)((T*)p); + + } + private: + /// Pointer on the Set method + SetMethodPointerType mSetMethodPointer; + }; + //=========================================================================== + +} +// namespace bbtk +#endif diff --git a/kernel/src/bbtkAtomicBlackBoxInputDescriptor.cxx b/kernel/src/bbtkAtomicBlackBoxInputDescriptor.cxx new file mode 100644 index 0000000..b0c6e8c --- /dev/null +++ b/kernel/src/bbtkAtomicBlackBoxInputDescriptor.cxx @@ -0,0 +1,60 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbtkAtomicBlackBoxInputDescriptor.cxx,v $ + Language: C++ + Date: $Date: 2008/02/07 11:06:37 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +/** + * \file + * \brief Class bbtk::AtomicBlackBoxInputDescriptor : structure containing the description of a AtomicBlackBox input (name, description, type, functor) + */ +#include "bbtkAtomicBlackBoxInputDescriptor.h" + + +namespace bbtk +{ + + AtomicBlackBoxInputDescriptor:: + AtomicBlackBoxInputDescriptor( TypeInfo creator_type_info, + const std::string& name, + const std::string& description, + AtomicBlackBoxGetFunctor* getfunctor, + AtomicBlackBoxSetFunctor* setfunctor, + bool copy_construct) + : + BlackBoxInputDescriptor(creator_type_info, + name,description,MANDATORY,copy_construct), + mGetFunctor(getfunctor), + mSetFunctor(setfunctor) + { + bbtkDebugMessage("Kernel",9, + "AtomicBlackBoxInputDescriptor::" + <<"AtomicBlackBoxInputDescriptor(\"" + < + +namespace bbtk +{ + + + class BBTK_EXPORT AtomicBlackBoxInputDescriptor : + public bbtk::BlackBoxInputDescriptor + { + public: + //typedef enum { + // MANDATORY, + // OPTIONAL + //} InputType; + + + AtomicBlackBoxInputDescriptor( TypeInfo creator_type_info, + const std::string& name, + const std::string& description, + AtomicBlackBoxGetFunctor* getfunctor, + AtomicBlackBoxSetFunctor* setfunctor, + bool copy_construct = true); + + ~AtomicBlackBoxInputDescriptor(); + /// Returns the type of the input + TypeInfo GetTypeInfo() const { return mGetFunctor->GetTypeInfo(); } + /// Returns the name of the type of the input + std::string GetTypeName() const { return mGetFunctor->GetTypeName(); } + /// Returns the name of the type of the input + std::string GetHumanTypeName() const { return mGetFunctor->GetHumanTypeName(); } + /// Returns true iff the type is a pointer to class + virtual bool IsPointerType() const { return mGetFunctor->IsPointerType(); } + /// Returns the functor on the Get method + AtomicBlackBoxGetFunctor* GetGetFunctor() { return mGetFunctor; } + /// Returns the functor on the Set method + AtomicBlackBoxSetFunctor* GetSetFunctor() { return mSetFunctor; } + + + private: + /// Default ctor is private + AtomicBlackBoxInputDescriptor() : + BlackBoxInputDescriptor(typeid(void),"","") {} + /// The functor on the Get method + AtomicBlackBoxGetFunctor* mGetFunctor; + /// The functor on the Set method + AtomicBlackBoxSetFunctor* mSetFunctor; + }; + +} +// namespace bbtk +#endif diff --git a/kernel/src/bbtkAtomicBlackBoxMacros.h b/kernel/src/bbtkAtomicBlackBoxMacros.h new file mode 100644 index 0000000..cd4028e --- /dev/null +++ b/kernel/src/bbtkAtomicBlackBoxMacros.h @@ -0,0 +1,683 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbtkAtomicBlackBoxMacros.h,v $ + Language: C++ + Date: $Date: 2008/02/07 11:06:37 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +/** + * \file + * \brief Defines macros for the creation of new user black boxes + */ +#ifndef __bbtkAtomicBlackBoxMacros_h__ +#define __bbtkAtomicBlackBoxMacros_h__ + +//============================================================================ +/// Declares the standard interface of a AtomicBlackBox +/// (ctor, New, descriptor related methods) +#define BBTK_USER_BLACK_BOX_INTERFACE(CLASS,PARENT) \ + private: \ + inline static void bbCreateDescriptorIfNeeded(); \ + protected: \ + CLASS(const std::string& name, bool allocate_connectors = true); \ + CLASS(CLASS& from, const std::string& name, \ + bool allocate_connectors = true); \ + ~CLASS(); \ + public: \ + inline static CLASS* bbNew(const std::string& name) \ + { \ + bbtkDebugMessageInc("Kernel",9,#CLASS<<"::bbNew(\""< "<bbGetFullName()<<"]"< \ + (&CLASS::bbGetInput##NAME), \ + new bbtk::AtomicBlackBoxTSetFunctor \ + (&CLASS::bbSetInput##NAME) ) ) +//============================================================================ + +//============================================================================ +/// Describes a AtomicBlackBox output (to be put inside the UBB description block) +#define BBTK_OUTPUT(CLASS,NAME,DESCR,TYPE) \ + AddOutputDescriptor(new bbtk::AtomicBlackBoxOutputDescriptor \ + (typeid(CLASS ## Descriptor),#NAME,DESCR, \ + new bbtk::AtomicBlackBoxTGetFunctor \ + (&CLASS::bbGetOutput##NAME), \ + new bbtk::AtomicBlackBoxTSetFunctor \ + (&CLASS::bbSetOutput##NAME) ) ) +//============================================================================ + +//============================================================================ +/// Describes a AtomicBlackBox input (to be put inside the UBB description block) +#define BBTK_INPUT_NOCOPY(CLASS,NAME,DESCR,TYPE) \ + AddInputDescriptor(new bbtk::AtomicBlackBoxInputDescriptor \ + (typeid(CLASS ## Descriptor),#NAME,DESCR, \ + new bbtk::AtomicBlackBoxTGetFunctor \ + (&CLASS::bbGetInput##NAME), \ + new bbtk::AtomicBlackBoxTSetFunctor \ + (&CLASS::bbSetInput##NAME), \ + false) ) +//============================================================================ + +//============================================================================ +/// Describes a AtomicBlackBox output (to be put inside the UBB description block) +#define BBTK_OUTPUT_NOCOPY(CLASS,NAME,DESCR,TYPE) \ + AddOutputDescriptor(new bbtk::AtomicBlackBoxOutputDescriptor \ + (typeid(CLASS ## Descriptor),#NAME,DESCR, \ + new bbtk::AtomicBlackBoxTGetFunctor \ + (&CLASS::bbGetOutput##NAME), \ + new bbtk::AtomicBlackBoxTSetFunctor \ + (&CLASS::bbSetOutput##NAME),\ + false) ) +//============================================================================ + + + + + + + + + + +//============================================================================ +//============================================================================ +// Template user black boxes macros +//============================================================================ +//============================================================================ + +//============================================================================ +/// Begins a template AtomicBlackBox of template param T description block +#define BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(CLASS) \ + template \ + class /*BBTK_EXPORT*/ CLASS ## Descriptor : public bbtk::BlackBoxDescriptor \ + { \ + public: \ + bbtk::BlackBox::Pointer CreateInstance(const std::string& name) \ + { \ + return CLASS::bbNew(name); \ + } \ + CLASS ## Descriptor() \ + { \ + bbtkDebugMessageInc("Kernel",9,#CLASS<<"Descriptor::"<<#CLASS \ + <<"Descriptor()"< \ + void CLASS::bbCreateDescriptorIfNeeded() \ + { \ + if ( !bbDescriptorPointer() ) \ + bbDescriptorPointer() = new CLASS ## Descriptor; \ + } +//============================================================================ + +//============================================================================ +/// Describes a template AtomicBlackBox input (to be put inside the template UBB description block) +#define BBTK_TEMPLATE_INPUT(CLASS,NAME,DESCR,TYPE) \ + AddInputDescriptor(new bbtk::AtomicBlackBoxInputDescriptor \ + (typeid(CLASS ## Descriptor),#NAME,DESCR, \ + new bbtk::AtomicBlackBoxTGetFunctor,TYPE,TYPE > \ + (&CLASS::bbGetInput##NAME), \ + new bbtk::AtomicBlackBoxTSetFunctor,TYPE,TYPE > \ + (&CLASS::bbSetInput##NAME) ) ) +//============================================================================ + +//============================================================================ +/// Describes a template AtomicBlackBox output (to be put inside the template UBB description block) +#define BBTK_TEMPLATE_OUTPUT(CLASS,NAME,DESCR,TYPE) \ + AddOutputDescriptor(new bbtk::AtomicBlackBoxOutputDescriptor \ + (typeid(CLASS ## Descriptor),#NAME,DESCR, \ + new bbtk::AtomicBlackBoxTGetFunctor,TYPE,TYPE > \ + (&CLASS::bbGetOutput##NAME), \ + new bbtk::AtomicBlackBoxTSetFunctor,TYPE,TYPE > \ + (&CLASS::bbSetOutput##NAME) ) ) +//============================================================================ + +//============================================================================ +/// Template AtomicBlackBox std implementation of ctor and dtor +#define BBTK_USER_BLACK_BOX_TEMPLATE_IMPLEMENTATION(CLASS,PARENT) \ + template \ + CLASS::CLASS(const std::string& name, bool alloc) \ + : PARENT(name,false) \ + { \ + BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,alloc); \ + CLASS::bbUserConstructor(); \ + BBTK_END_BLACK_BOX_CONSTRUCTOR; \ + } \ + template \ + CLASS::CLASS(CLASS& from, \ + const std::string& name, bool allocate_connectors) \ + : PARENT(from,name,false) \ + { \ + BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \ + CLASS::bbUserCopyConstructor(); \ + BBTK_END_BLACK_BOX_CONSTRUCTOR; \ + } \ + template \ + CLASS::~CLASS() \ + { \ + BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \ + CLASS::bbUserDestructor(); \ + BBTK_END_BLACK_BOX_DESTRUCTOR; \ + } +//============================================================================ + +//============================================================================ +// Two template params user black boxes macros + +/// Begins a template AtomicBlackBox description block of template param T1 and T2 +#define BBTK_BEGIN_DESCRIBE_TEMPLATE2_BLACK_BOX(CLASS) \ + template \ + class /*BBTK_EXPORT*/ CLASS ## Descriptor : public bbtk::BlackBoxDescriptor \ + { \ + public: \ + bbtk::BlackBox::Pointer CreateInstance(const std::string& name) \ + { \ + return CLASS::bbNew(name); \ + } \ + CLASS ## Descriptor() \ + { \ + bbtkDebugMessageInc("Kernel",9,#CLASS<<"Descriptor::"<<#CLASS \ + <<"Descriptor()"< \ + void CLASS::bbCreateDescriptorIfNeeded() \ + { \ + if ( !bbDescriptorPointer() ) \ + bbDescriptorPointer() = new CLASS ## Descriptor; \ + } +//============================================================================ + +//============================================================================ +// Two template params user black boxes macros + +/// Begins a template AtomicBlackBox description block of template param T1 and T2 +#define BBTK_BEGIN_DESCRIBE_TEMPLATE2_WITH_TYPES_BLACK_BOX(CLASS,TYPE1,TYPE2) \ + template \ + class /*BBTK_EXPORT*/ CLASS ## Descriptor : public bbtk::BlackBoxDescriptor \ + { \ + public: \ + bbtk::BlackBox::Pointer CreateInstance(const std::string& name) \ + { \ + return new CLASS(name); \ + } \ + CLASS ## Descriptor() \ + { \ + bbtkDebugMessageInc("Kernel",9,#CLASS<<"Descriptor::"<<#CLASS \ + <<"Descriptor()"< \ + void CLASS::bbCreateDescriptorIfNeeded() \ + { \ + if ( !bbDescriptorPointer() ) \ + bbDescriptorPointer() = new CLASS ## Descriptor; \ + } +//============================================================================ + + + +//============================================================================ +/// Describes a 2 template params AtomicBlackBox input (to be put inside the UBB description block) +#define BBTK_TEMPLATE2_INPUT(CLASS,NAME,DESCR,TYPE) \ + AddInputDescriptor(new bbtk::AtomicBlackBoxInputDescriptor \ + (typeid(CLASS ## Descriptor),#NAME,DESCR, \ + new bbtk::AtomicBlackBoxTGetFunctor,TYPE,TYPE > \ + (&CLASS::bbGetInput##NAME), \ + new bbtk::AtomicBlackBoxTSetFunctor,TYPE,TYPE > \ + (&CLASS::bbSetInput##NAME) ) ) +//============================================================================ + +//============================================================================ +/// Describes a 2 template params AtomicBlackBox output (to be put inside the UBB description block) +#define BBTK_TEMPLATE2_OUTPUT(CLASS,NAME,DESCR,TYPE) \ + AddOutputDescriptor(new bbtk::AtomicBlackBoxOutputDescriptor \ + (typeid(CLASS ## Descriptor),#NAME,DESCR, \ + new bbtk::AtomicBlackBoxTGetFunctor,TYPE,TYPE > \ + (&CLASS::bbGetOutput##NAME), \ + new bbtk::AtomicBlackBoxTSetFunctor,TYPE,TYPE > \ + (&CLASS::bbSetOutput##NAME) ) ) +//============================================================================ + +//============================================================================ +/// Template AtomicBlackBox std implementation of ctor and dtor +#define BBTK_USER_BLACK_BOX_TEMPLATE2_IMPLEMENTATION(CLASS,PARENT) \ + template \ + CLASS::CLASS(const std::string& name, bool alloc) \ + : PARENT(name,false) \ + { \ + BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,alloc); \ + CLASS::bbUserConstructor(); \ + BBTK_END_BLACK_BOX_CONSTRUCTOR; \ + } \ + template \ + CLASS::CLASS(CLASS& from, \ + const std::string& name, bool allocate_connectors) \ + : PARENT(from,name,false) \ + { \ + BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \ + CLASS::bbUserCopyConstructor(); \ + BBTK_END_BLACK_BOX_CONSTRUCTOR; \ + } \ + template \ + CLASS::~CLASS() \ + { \ + BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \ + CLASS::bbUserDestructor(); \ + BBTK_END_BLACK_BOX_DESTRUCTOR; \ + } +//============================================================================ + + +//============================================================================ +/// Template AtomicBlackBox std implementation of ctor and dtor +#define BBTK_USER_BLACK_BOX_TEMPLATE2_WITH_TYPES_IMPLEMENTATION(CLASS,PARENT,TYPE1,TYPE2) \ + template \ + CLASS::CLASS(const std::string& name, bool alloc) \ + : PARENT(name,false) \ + { \ + BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,alloc); \ + this->bbUserConstructor(); \ + BBTK_END_BLACK_BOX_CONSTRUCTOR; \ + } \ + template \ + CLASS::CLASS(CLASS& from, \ + const std::string& name, bool allocate_connectors) \ + : PARENT(from,name,false) \ + { \ + BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \ + this->bbUserCopyConstructor(); \ + BBTK_END_BLACK_BOX_CONSTRUCTOR; \ + } \ + template \ + CLASS::~CLASS() \ + { \ + BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \ + this->bbUserDestructor(); \ + BBTK_END_BLACK_BOX_DESTRUCTOR; \ + } +//============================================================================ + + + + + +//=========================================================================== +//============================================================================ +// ITK Specific macros +//=========================================================================== +//=========================================================================== + + +//=========================================================================== +/// Declares an itk-inherited AtomicBlackBox input +#define BBTK_DECLARE_ITK_INPUT(PARENT,NAME,TYPE) \ + public: \ + TYPE bbGetInput##NAME () \ + { return PARENT::GetInput(); } \ + void bbSetInput##NAME (TYPE d) \ + { PARENT::SetInput(d); \ + /*bbSetModifiedStatus();*/ } +//=========================================================================== + +//=========================================================================== +#define BBTK_DECLARE_ITK_OUTPUT(PARENT,NAME,TYPE) \ + public: \ + TYPE bbGetOutput##NAME () \ + { return PARENT::GetOutput(); } \ + void bbSetOutput##NAME (TYPE d) \ + { /*PARENT::GetOutput() = d;*/ } +//=========================================================================== + +//=========================================================================== +/// Declares an AtomicBlackBox input corresponding to an inherited itk parameter +/// which was declared by itkSetMacro/itkGetMacro +/// The NAME **MUST** be the same than the itk parameter name +#define BBTK_DECLARE_ITK_PARAM(PARENT,NAME,TYPE) \ + public: \ + TYPE bbGetInput##NAME () \ + { return PARENT::Get##NAME(); } \ + void bbSetInput##NAME (TYPE d) \ + { PARENT::Set##NAME(d); \ + /*bbSetModifiedStatus();*/ } +//=========================================================================== + + + + +//=========================================================================== +//============================================================================ +// VTK Specific macros +//=========================================================================== +//=========================================================================== + + +//=========================================================================== + +// EED sept 04 \ +// { return GetInput(); /*PARENT::GetInput();*/ } \ +// { PARENT::SetInput( /*(vtkDataObject*)*/ d); \ + + + +/// Declares a vtkImageAlgorithm-inherited AtomicBlackBox input +#define BBTK_DECLARE_VTK_IMAGE_ALGORITHM_INPUT(PARENT,NAME,TYPE) \ + public: \ + TYPE bbGetInput##NAME () \ + { return GetImageDataInput(0); /*PARENT::GetInput();*/ } \ + void bbSetInput##NAME (TYPE d) \ + { PARENT::SetInput( (vtkDataObject*) d); \ + /*bbSetModifiedStatus();*/ } +//=========================================================================== +/// Declares a vtkPolyDataAlgorithm-inherited AtomicBlackBox input +#define BBTK_DECLARE_VTK_POLY_DATA_ALGORITHM_INPUT(PARENT,NAME,TYPE) \ + public: \ + TYPE bbGetInput##NAME () \ + { return GetPolyDataInput(0); /*PARENT::GetInput();*/ } \ + void bbSetInput##NAME (TYPE d) \ + { PARENT::SetInput( (vtkDataObject*) d); \ + /*bbSetModifiedStatus();*/ } +//=========================================================================== + +//=========================================================================== +/// Declares a vtkImageAlgorithm-inherited AtomicBlackBox output +#define BBTK_DECLARE_VTK_OUTPUT(PARENT,NAME,TYPE) \ + public: \ + TYPE bbGetOutput##NAME () \ + { return PARENT::GetOutput(); } \ + void bbSetOutput##NAME (TYPE d) \ + { /*PARENT::GetOutput() = d;*/ } +//=========================================================================== + +//=========================================================================== +/// Declares a vtkAlgorithm-inherited AtomicBlackBox input +#define BBTK_DECLARE_VTK_INPUT(PARENT,NAME,TYPE) \ + public: \ + TYPE bbGetInput##NAME () \ + { return dynamic_cast(PARENT::GetInput()); } \ + void bbSetInput##NAME (TYPE d) \ + { PARENT::SetInput( (vtkDataObject*) d); /*PARENT::GetOutput() = d;*/ } + +//=========================================================================== + +//=========================================================================== +/// Declares an AtomicBlackBox input corresponding to an inherited vtk parameter +/// which was declared by vtkSetMacro/vtkGetMacro +/// The NAME **MUST** be the same than the vtk parameter name +#define BBTK_DECLARE_VTK_PARAM(PARENT,NAME,TYPE) \ + public: \ + TYPE bbGetInput##NAME () \ + { return PARENT::Get##NAME(); } \ + void bbSetInput##NAME (TYPE d) \ + { PARENT::Set##NAME(d); \ + /*bbSetModifiedStatus();*/ } +//=========================================================================== + + + +//=========================================================================== +/// EOF +//=========================================================================== +#endif diff --git a/kernel/src/bbtkAtomicBlackBoxOutputDescriptor.cxx b/kernel/src/bbtkAtomicBlackBoxOutputDescriptor.cxx new file mode 100644 index 0000000..db79f8f --- /dev/null +++ b/kernel/src/bbtkAtomicBlackBoxOutputDescriptor.cxx @@ -0,0 +1,57 @@ +/*========================================================================= + + Program: bbtk + Module: $RCSfile: bbtkAtomicBlackBoxOutputDescriptor.cxx,v $ + Language: C++ + Date: $Date: 2008/02/07 11:06:37 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +/** + * \file + * \brief Class bbtk::AtomicBlackBoxOutputDescriptor : structure containing the description of a AtomicBlackBox output (name, description, type, functor) + */ +#include "bbtkAtomicBlackBoxOutputDescriptor.h" + + +namespace bbtk +{ + + + AtomicBlackBoxOutputDescriptor:: + AtomicBlackBoxOutputDescriptor( TypeInfo creator_type_info, + const std::string& name, + const std::string& description, + AtomicBlackBoxGetFunctor* getfunctor, + AtomicBlackBoxSetFunctor* setfunctor, + bool copy_construct ) + : + BlackBoxOutputDescriptor(creator_type_info, + name,description,copy_construct), + mGetFunctor(getfunctor), + mSetFunctor(setfunctor) + { + + bbtkDebugMessage("Kernel",9, + "AtomicBlackBoxOutputDescriptor::AtomicBlackBoxOutputDescriptor(\"" + <GetTypeInfo(); } + /// Returns the name of the type of the input + std::string GetTypeName() const { return mGetFunctor->GetTypeName(); } + /// Returns the name of the type of the input + std::string GetHumanTypeName() const { return mGetFunctor->GetHumanTypeName(); } + /// Returns true iff the type is a pointer to class + virtual bool IsPointerType() const { return mGetFunctor->IsPointerType(); } /// Returns the functor on the Get method + AtomicBlackBoxGetFunctor* GetGetFunctor() { return mGetFunctor; } + /// Returns the functor on the Set method + AtomicBlackBoxSetFunctor* GetSetFunctor() { return mSetFunctor; } + + + private: + /// Default ctor is private + AtomicBlackBoxOutputDescriptor() : + BlackBoxOutputDescriptor(typeid(void),"","") {} + /// The functor on the Get method + AtomicBlackBoxGetFunctor* mGetFunctor; + /// The functor on the Set method + AtomicBlackBoxSetFunctor* mSetFunctor; + }; + + +} +// namespace bbtk +#endif diff --git a/kernel/src/bbtkBlackBoxDescriptor.cxx b/kernel/src/bbtkBlackBoxDescriptor.cxx index 6f5ab20..cd15961 100644 --- a/kernel/src/bbtkBlackBoxDescriptor.cxx +++ b/kernel/src/bbtkBlackBoxDescriptor.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBoxDescriptor.cxx,v $ Language: C++ - Date: $Date: 2008/02/07 07:58:53 $ - Version: $Revision: 1.10 $ + Date: $Date: 2008/02/07 11:06:37 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -232,7 +232,8 @@ namespace bbtk std::string descr = GetDescription(); - //Utilities::html_format(descr); + Utilities::html_format(descr); + std::cout << "HTML *** "<second->GetDescription()); - //Utilities::html_format(descr); + Utilities::html_format(descr); std::string out = "second->GetDescription()); - //Utilities::html_format(descr); + Utilities::html_format(descr); std::string out = "0) { - (s) << " Use command : include " + (s) << " To use it : include " << inc << "\n"; } @@ -371,7 +371,7 @@ namespace bbtk Utilities::html_format(type); std::string descr(in->second->GetDescription()); - //Utilities::html_format(descr); + Utilities::html_format(descr); (s) << "
 "<"
 	  << "
 "<"
@@ -404,7 +404,7 @@ namespace bbtk
 	Utilities::html_format(type);
 	
 	std::string descr(o->second->GetDescription());
-	//Utilities::html_format(descr);
+	Utilities::html_format(descr);
 	
 	(s) << "
 "<"
 	  << "
 "<"
diff --git a/kernel/src/bbtkRTTI.h b/kernel/src/bbtkRTTI.h
index ca7ec42..89366e9 100644
--- a/kernel/src/bbtkRTTI.h
+++ b/kernel/src/bbtkRTTI.h
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkRTTI.h,v $
   Language:  C++
-  Date:      $Date: 2008/01/22 15:02:00 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2008/02/07 11:06:37 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -136,36 +136,35 @@ namespace bbtk
     template <> inline std::string HumanTypeName< TYPE >(const TYPE&)	\
     { return NAME; }	
   
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::string,"std::string");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(signed char,"char");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(signed short,"short");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(signed int,"int");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(unsigned char,"unsigned char");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(unsigned short,"unsigned short");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(unsigned int,"unsigned int");
-  
-  // Human readable strings for std::vector
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::vector,
-				       "std::vector");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::vector,
-				       "std::vector");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::vector,
-				       "std::vector");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::vector,
-				       "std::vector");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::vector,
-				       "std::vector");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::vector,
-				       "std::vector");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::vector,
-				       "std::vector");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::vector,
-				       "std::vector");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::vector,
-				       "std::vector");
-  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::vector,
-				       "std::vector");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(std::string,"String");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(signed char,"Char");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(signed short,"Short");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(signed int,"Int");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(unsigned char,"UChar");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(unsigned short,"UShort");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(unsigned int,"UInt");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(float,"Float");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(double,"Double");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(bool,"Bool");
+  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME(long,"Long");
 
+  // Human readable strings for std::vector
+#define BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(TYPE)		\
+  template <> inline std::string HumanTypeName< std::vector >()	\
+  { return "Vector"+HumanTypeName(); }				\
+    template <> inline std::string HumanTypeName< std::vector >	\
+    (const std::vector&) { return "Vector"+HumanTypeName(); }	
+
+  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(int8_t);
+  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(uint8_t);
+  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(int16_t);
+  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(uint16_t);
+  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(int32_t);
+  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(uint32_t);
+  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(long);
+  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(float);
+  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(double);
+  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(std::string);
 
 /// The bbtk::TypeInfo type is a const ref on std::type_info (which can only be manipulated as such (because typeid returns const std::type_info& and type_info has all constructors private)) 
   typedef const std::type_info& TypeInfo;
-- 
2.46.1