<output name="Out" type="double" description="First output"/>
<!--=====================================================================-->
- <!--========================================================================
- THE PROCESSING METHOD BODY :
- Here simpy copies the value of the input 'In' to the output 'Out'
- And prints out the value
- INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
- void bbSet{Input|Output}NAME(const TYPE&)
- const TYPE& bbGet{Input|Output}NAME() const
- Where :
- * NAME is the name of the input/output
- (the one provided in the attribute 'name' of the tag 'input')
- * TYPE is the C++ type of the input/output
- (the one provided in the attribute 'type' of the tag 'input') -->
-
<process>
<PRE>
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
bbSetOutputOut( bbGetInputIn() );
std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
</PRE>
</process>
<!--=====================================================================-->
- <!--========================================================================
- CONSTRUCTORS / DESTRUCTORS (OPTIONAL)
- THE CONSTRUCTION METHOD BODY :
- Here initializes the input 'In' to 0
- This is also where you should allocate the output pointers -->
- <constructor>
+ <defaultValues>
<PRE>
- bbSetInputIn(0);
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputIn(0);
</PRE>
- </constructor>
+ </defaultValues>
+
- <!-- THE COPY-CONSTRUCTION METHOD BODY :
- Here does nothing
- But this is where you should allocate the output pointers if any
- and copy the pointed values (to avoid bug caused by multiple references)-->
- <copyconstructor>
+
+ <initializeProcessing>
<PRE>
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
</PRE>
- </copyconstructor>
+ </initializeProcessing>
- <!-- THE DESTRUCTION METHOD BODY :
- Here does nothing
- but this is where you should desallocate the output pointers if any -->
- <destructor>
+ <finalizeProcessing>
<PRE>
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
</PRE>
- </destructor>
- <!--=====================================================================-->
+ </finalizeProcessing>
+ <!--=====================================================================-->
<!--=======================================================================-->
<!-- END OF BLACK BOX DESCRIPTION -->
std::vector<std::string> mInclude;
std::vector<std::string> mTypedef;
- std::string mUserConstructor;
- std::string mUserCopyConstructor;
- std::string mUserDestructor;
+ std::string mUserSetDefaultValues;
+ std::string mUserInitializeProcessing;
+ std::string mUserFinalizeProcessing;
typedef struct
{
bbtk::GetTextOrClear(BB.getChildNode("namespace"),mNamespace);
}
- // UserConstructor body
- if (BB.nChildNode("constructor"))
+ // UserSetDefaultValues body
+ if (BB.nChildNode("defaultValues"))
{
- bbtk::GetTextOrClear(BB.getChildNode("constructor"),mUserConstructor);
+ bbtk::GetTextOrClear(BB.getChildNode("defaultValues"),
+ mUserSetDefaultValues);
}
- // UserCopyConstructor body
- if (BB.nChildNode("copyconstructor"))
+ // UserInitializeProcessing body
+ if (BB.nChildNode("initializeProcessing"))
{
- bbtk::GetTextOrClear(BB.getChildNode("copyconstructor"),mUserCopyConstructor);
+ bbtk::GetTextOrClear(BB.getChildNode("initializeProcessing"),
+ mUserInitializeProcessing);
}
- // UserDestructor body
- if (BB.nChildNode("destructor"))
+ // UserFinalizeProcessing body
+ if (BB.nChildNode("finalizeProcessing"))
{
- bbtk::GetTextOrClear(BB.getChildNode("destructor"),mUserDestructor);
+ bbtk::GetTextOrClear(BB.getChildNode("finalizeProcessing"),
+ mUserFinalizeProcessing);
}
-
- // Template parameters
+
+
+
+ // Template parameters
// mNbTemplateParam = BB.nChildNode("template");
if ( BB.nChildNode("template") > 0)
{
bbtk::GetTextOrClear(BB.getChildNode("createwidget"),mCreateWidget);
}
+
+
+
+
+
+
+
+ // OBSOLETE/UNSUPPORTED TAGS
+ // WARN IF OBSOLETE TAGS PROVIDED
+ if (BB.nChildNode("constructor"))
+ {
+ std::cout << "WARNING !!! The tag <constructor> is obsolete !!"<<std::endl;
+ }
+ if (BB.nChildNode("destructor"))
+ {
+ std::cout << "WARNING !!! The tag <destructor> is obsolete !!"<<std::endl;
+ }
+ if (BB.nChildNode("copy_constructor"))
+ {
+ std::cout << "WARNING !!! The tag <copy_constructor> is obsolete !!"<<std::endl;
+ }
+
+
+
}
//==========================================================================
}
// Declare user constructor / copy cons /destr
+ /*
mFile << "//=================================================================="<<std::endl;
mFile << "/// User callback called in the box contructor"<<std::endl;
mFile << "virtual void bbUserDestructor();"<<std::endl;
mFile << "//=================================================================="<<std::endl;
-
+ */
// Inputs
std::vector<IO>::iterator ioi;
}
// User constr / copy constr / destr implementation
- mFile <<"void "<<mName<<"::bbUserConstructor()"<<std::endl;
- mFile << "{"<<std::endl;
- //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserConstructor()"<<std::endl);"<<std::endl;
-
- mFile << mUserConstructor << std::endl;
+ mFile <<"void "<<mName<<"::bbUserSetDefaultValues()"<<std::endl;
+ mFile << "{"<<std::endl;
+ mFile << mUserSetDefaultValues << std::endl;
mFile << "}" << std::endl;
- mFile <<"void "<<mName<<"::bbUserCopyConstructor(bbtk::BlackBox::Pointer)"
+ mFile <<"void "<<mName<<"::bbUserInitializeProcessing()"
<<std::endl;
mFile << "{"<<std::endl;
- //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserCopyConstructor()"<<std::endl);"<<std::endl;
- mFile << mUserCopyConstructor << std::endl;
+ mFile << mUserInitializeProcessing << std::endl;
mFile << "}" << std::endl;
- mFile <<"void "<<mName<<"::bbUserDestructor()"<<std::endl;
+ mFile <<"void "<<mName<<"::bbUserFinalizeProcessing()"<<std::endl;
mFile << "{"<<std::endl;
- //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserDestructor()"<<std::endl);"<<std::endl;
- mFile << mUserDestructor << std::endl;
+ mFile << mUserFinalizeProcessing << std::endl;
mFile << "}" << std::endl;
#-----------------------------------------------------------------------------
# BOOST C++
-SET(BBTK_SHIPPED_BOOST boost_1_35_0 CACHE INTERNAL "Shipped boost dir" FORCE)
-OPTION(BBTK_USE_SHIPPED_BOOST
- "Use the shipped boost C++ library (${BBTK_SHIPPED_BOOST})" ON)
+#SET(BBTK_SHIPPED_BOOST boost_1_35_0 CACHE INTERNAL "Shipped boost dir" FORCE)
+#OPTION(BBTK_USE_SHIPPED_BOOST
+# "Use the shipped boost C++ library (${BBTK_SHIPPED_BOOST})" ON)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# USE SHIPPED BOOST ?
IF(BBTK_KERNEL OR BBTK_CORE_PACKAGE)
-IF(BBTK_USE_SHIPPED_BOOST)
+#IF(BBTK_USE_SHIPPED_BOOST)
- MESSAGE ( STATUS "=======================================")
- MESSAGE ( STATUS "bbtk uses shipped boost C++ library (${BBTK_SHIPPED_BOOST})")
- INCLUDE_DIRECTORIES(
- ${PROJECT_SOURCE_DIR}/kernel/src/ThirdParty/${BBTK_SHIPPED_BOOST})
+# MESSAGE ( STATUS "=======================================")
+# MESSAGE ( STATUS "bbtk uses shipped boost C++ library (${BBTK_SHIPPED_BOOST})")
+# INCLUDE_DIRECTORIES(
+# ${PROJECT_SOURCE_DIR}/kernel/src/ThirdParty/${BBTK_SHIPPED_BOOST})
# TO DO : CLEANLY BLOCK auto_link.hpp INCLUSION
#CREA_DEFINE(BOOST_SIGNALS_NO_LIB)
- SET(BBTK_BOOST_LIBRARIES
- bbtk_boost_signals
- )
+# SET(BBTK_BOOST_LIBRARIES
+# bbtk_boost_signals
+# )
-ELSE(BBTK_USE_SHIPPED_BOOST)
+#ELSE(BBTK_USE_SHIPPED_BOOST)
SET(USE_BOOST ON CACHE BOOL "Use boost C++ library" FORCE)
SET(BBTK_BOOST_LIBRARIES
boost_signals
)
-ENDIF(BBTK_USE_SHIPPED_BOOST)
+#ENDIF(BBTK_USE_SHIPPED_BOOST)
ENDIF(BBTK_KERNEL OR BBTK_CORE_PACKAGE)
#-----------------------------------------------------------------------------
SET(LIBRARY_NAME BBTK)
SET(${LIBRARY_NAME}_INSTALL_FOLDER bbtk)
SET(${LIBRARY_NAME}_LIBRARIES bbtk)
-SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS kernel/src kernel/src/ThirdParty)
-IF(BBTK_USE_SHIPPED_BOOST)
- SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS
- ${${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS}
- kernel/src/ThirdParty/${BBTK_SHIPPED_BOOST}
- )
-ENDIF(BBTK_USE_SHIPPED_BOOST)
+SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS kernel/src)
+#kernel/src/ThirdParty)
+#IF(BBTK_USE_SHIPPED_BOOST)
+# SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS
+# ${${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS}
+# kernel/src/ThirdParty/${BBTK_SHIPPED_BOOST}
+# )
+#ENDIF(BBTK_USE_SHIPPED_BOOST)
IF(UNIX)
SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
${EXECUTABLE_OUTPUT_REL_PATH})
#${EXECUTABLE_OUTPUT_REL_PATH})/Debug
#${EXECUTABLE_OUTPUT_REL_PATH}/Release)
ENDIF(UNIX)
-SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/bbtk include/bbtk/ThirdParty)
+SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/bbtk)
+# include/bbtk/ThirdParty)
SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS ${BBTK_LIB_PATH})
# OPTIONAL
#-----------------------------------------------------------------------------
# Recurse in ThirdParty to build the needed libs
-SUBDIRS(ThirdParty)
+#SUBDIRS(ThirdParty)
#-----------------------------------------------------------------------------
MESSAGE(STATUS "=======================================")
-#-----------------------------------------------------------------------------
-# If bbtk uses shipped boost then recurse in boost to build the needed libs
-IF(BBTK_USE_SHIPPED_BOOST)
- SUBDIRS(${BBTK_SHIPPED_BOOST})
-ENDIF(BBTK_USE_SHIPPED_BOOST)
-#-----------------------------------------------------------------------------
Program: bbtk
Module: $RCSfile: bbtkAtomicBlackBox.h,v $
Language: C++
- Date: $Date: 2009/04/30 14:31:30 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2009/05/14 14:43:33 $
+ Version: $Revision: 1.10 $
=========================================================================*/
/* ---------------------------------------------------------------------
//==================================================================
//==================================================================
- /// User callback called in the box contructor
- virtual void bbUserConstructor() {}
- /// User callback called in the box copy constructor
- virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer) {}
- /// User callback called in the box destructor
- virtual void bbUserDestructor() {}
+ /// *** TO BE REMOVED WHEN EVERYTHING IS OK ***
+ /// CHANGED RETURN TYPE OF bbUserConstructor FROM void TO int
+ /// TO PRODUCE COMPILATION ERROR IF AN USER DECLARES THE OLD
+ /// METHOD bbUserConstructor IN ITS BOX
+ virtual int bbUserConstructor() { return 0; }
+ /// *** TO BE REMOVED WHEN EVERYTHING IS OK ***
+ /// THE SAME AS bbUserConstructor
+ virtual int bbUserCopyConstructor(bbtk::BlackBox::Pointer) { return 0; }
+ /// *** TO BE REMOVED WHEN EVERYTHING IS OK ***
+ /// THE SAME AS bbUserConstructor
+ virtual int bbUserDestructor() { return 0; }
//==================================================================
- //==================================================================
- /// System callback which calls bbUserConstructor for all its ancestors
- /// and the box itself
- virtual void bbConstructor() {}
- /// System callback which calls bbUserDestructor for all its ancestors
- /// and the box itself
- virtual void bbDestructor() {}
- //==================================================================
//==================================================================
private:
Program: bbtk
Module: $RCSfile: bbtkAtomicBlackBoxMacros.h,v $
Language: C++
- Date: $Date: 2009/04/30 14:31:30 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2009/05/14 14:43:33 $
+ Version: $Revision: 1.16 $
=========================================================================*/
/* ---------------------------------------------------------------------
{ return std::string(#CLASS)+std::string(" '") \
+bbGetNameWithParent()+std::string("'"); } \
virtual void bbLockDescriptor(); \
- virtual void bbConstructor() { \
- PARENT::bbConstructor(); \
- CLASS::bbUserConstructor(); \
+ virtual void bbUserSetDefaultValues(); \
+ virtual void bbUserInitializeProcessing(); \
+ virtual void bbUserFinalizeProcessing(); \
+ virtual void bbRecursiveInitializeProcessing() \
+ { \
+ PARENT::bbRecursiveInitializeProcessing(); \
+ CLASS::bbUserInitializeProcessing(); \
} \
- virtual void bbDestructor() { \
- PARENT::bbDestructor(); \
- CLASS::bbUserDestructor(); \
+ virtual void bbRecursiveFinalizeProcessing() \
+ { \
+ CLASS::bbUserFinalizeProcessing(); \
+ PARENT::bbRecursiveFinalizeProcessing(); \
} \
private: \
CLASS() : PARENT("") {} \
return p; \
} \
virtual void bbLockDescriptor(); \
- virtual void bbConstructor() { \
- PARENT::bbConstructor(); \
- CLASS::bbUserConstructor(); \
+ virtual void bbUserSetDefaultValues(); \
+ virtual void bbUserInitializeProcessing(); \
+ virtual void bbUserFinalizeProcessing(); \
+ virtual void bbRecursiveInitializeProcessing() \
+ { \
+ PARENT::bbRecursiveInitializeProcessing(); \
+ CLASS::bbUserInitializeProcessing(); \
} \
- virtual void bbDestructor() { \
- PARENT::bbDestructor(); \
- CLASS::bbUserDestructor(); \
+ virtual void bbRecursiveFinalizeProcessing() \
+ { \
+ CLASS::bbUserFinalizeProcessing(); \
+ PARENT::bbRecursiveFinalizeProcessing(); \
} \
private: \
CLASS() : PARENT("") {} \
{ \
bbLockDescriptor(); \
bbAllocateConnectors(); \
- }
+ }
+
//============================================================================
//============================================================================
{ \
bbLockDescriptor(); \
bbAllocateConnectors(); \
- bbCopyIOValues(FROM); \
- }
+ }
//============================================================================
//============================================================================
-#define BBTK_END_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,FROM) \
+#define BBTK_END_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,FROM,ALLOC) \
bbtkDebugMessage("object",2,"<== "<<#CLASS<<"::"<<#CLASS \
<<"("<<FROM.bbGetFullName()<<",\"" \
- <<bbGetName()<<"\")"<<std::endl);
+ <<bbGetName()<<"\")"<<std::endl); \
+ if (ALLOC) \
+ { \
+ bbCopyIOValues(FROM); \
+ }
//============================================================================
//============================================================================
#define BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS) \
bbtkDebugMessage("object",2,"==> "<<#CLASS <<"::~"<< #CLASS \
- <<"() ["<<this->bbGetFullName()<<"]"<<std::endl);
+ <<"() ["<<this->bbGetFullName()<<"]"<<std::endl);
+
+
//============================================================================
//============================================================================
: PARENT(name,false) \
{ \
BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,allocate_connectors); \
- /*CLASS::bbUserConstructor(); */ \
+ CLASS::bbUserSetDefaultValues(); \
BBTK_END_BLACK_BOX_CONSTRUCTOR(CLASS); \
} \
CLASS::CLASS(CLASS& from, \
: PARENT(from,name,false) \
{ \
BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \
- /*CLASS::bbUserCopyConstructor(from.GetThisPointer<bbtk::BlackBox>());*/ \
- BBTK_END_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from); \
+ CLASS::bbUserSetDefaultValues(); \
+ BBTK_END_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \
} \
CLASS::~CLASS() \
{ \
BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \
- /*CLASS::bbUserDestructor();*/ \
+ CLASS::bbUserFinalizeProcessing(); \
BBTK_END_BLACK_BOX_DESTRUCTOR(CLASS); \
} \
void CLASS::bbLockDescriptor() \
: PARENT(name,false) \
{ \
BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,alloc); \
- /*CLASS<T>::bbUserConstructor();*/ \
+ CLASS<T>::bbUserSetDefaultValues(); \
BBTK_END_BLACK_BOX_CONSTRUCTOR(CLASS); \
} \
template <class T> \
: PARENT(from,name,false) \
{ \
BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \
- /*CLASS<T>::bbUserCopyConstructor(from.GetThisPointer<bbtk::BlackBox>());*/ \
- BBTK_END_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from); \
+ CLASS<T>::bbUserSetDefaultValues(); \
+ BBTK_END_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \
} \
template <class T> \
CLASS<T>::~CLASS() \
{ \
BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \
- /*CLASS<T>::bbUserDestructor();*/ \
+ CLASS<T>::bbFinalizeProcessing(); \
BBTK_END_BLACK_BOX_DESTRUCTOR(CLASS); \
} \
template <class T> \
: PARENT(name,false) \
{ \
BBTK_BEGIN_BLACK_BOX_CONSTRUCTOR(CLASS,alloc); \
- /*CLASS<T1,T2>::bbUserConstructor();*/ \
+ CLASS<T1,T2>::bbUserSetDefaultValues(); \
BBTK_END_BLACK_BOX_CONSTRUCTOR(CLASS); \
} \
template <class T1, class T2> \
: PARENT(from,name,false) \
{ \
BBTK_BEGIN_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \
- /*CLASS<T1,T2>::bbUserCopyConstructor(from.GetThisPointer<bbtk::BlackBox>());*/ \
- BBTK_END_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from); \
+ CLASS<T1,T2>::bbUserSetDefaultValues(); \
+ BBTK_END_BLACK_BOX_COPY_CONSTRUCTOR(CLASS,from,allocate_connectors); \
} \
template <class T1, class T2> \
CLASS<T1,T2>::~CLASS() \
{ \
BBTK_BEGIN_BLACK_BOX_DESTRUCTOR(CLASS); \
- /*CLASS<T1,T2>::bbUserDestructor();*/ \
+ CLASS<T1,T2>::bbFinalizeProcessing(); \
BBTK_END_BLACK_BOX_DESTRUCTOR(CLASS); \
} \
template <class T1, class T2> \
Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
- Date: $Date: 2009/04/30 14:31:31 $
- Version: $Revision: 1.43 $
+ Date: $Date: 2009/05/14 14:43:33 $
+ Version: $Revision: 1.44 $
=========================================================================*/
/* ---------------------------------------------------------------------
BlackBox::BlackBox(const std::string &name)
:
// bbmStatus(MODIFIED),
- bbmConstructed(false),
+ bbmInitialized(false),
bbmExecuting(false),
bbmName(name),
bbmBoxProcessMode("Pipeline"),
BlackBox::BlackBox(BlackBox& from, const std::string &name)
:
// bbmStatus(from.bbmStatus),
- bbmConstructed(false),
+ bbmInitialized(false),
bbmExecuting(false),
bbmName(name),
bbmBoxProcessMode(from.bbmBoxProcessMode),
}
//=========================================================================
+ //=========================================================================
+ void BlackBox::bbInitializeProcessing()
+ {
+ if (!bbmInitialized)
+ {
+ std::cout << "INIT "<<bbGetFullName()<<std::endl;
+ this->bbRecursiveInitializeProcessing();
+ bbmInitialized = true;
+ }
+ }
+ //=========================================================================
+ //=========================================================================
+ void BlackBox::bbFinalizeProcessing()
+ {
+ if (bbmInitialized)
+ {
+ std::cout << "FINI "<<bbGetFullName()<<std::endl;
+ this->bbRecursiveFinalizeProcessing();
+ bbmInitialized = false;
+ }
+ }
+ //=========================================================================
+
+
//=========================================================================
/// Main recursive processing method of the box.
void BlackBox::bbRecursiveExecute( Connection::Pointer caller )
return;
}
- // If not constructed do it
- if (!bbmConstructed)
- {
- this->bbConstructor();
- bbmConstructed = true;
- }
-
+ // If not initialized do it
+ bbInitializeProcessing();
bbSetExecuting(true);
bool wasExecuting = bbGlobalGetSomeBoxExecuting();
Program: bbtk
Module: $RCSfile: bbtkBlackBox.h,v $
Language: C++
- Date: $Date: 2009/04/30 14:31:31 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2009/05/14 14:43:33 $
+ Version: $Revision: 1.25 $
=========================================================================*/
/* ---------------------------------------------------------------------
- //==================================================================
- /// System callback which calls bbUserConstructor for all its ancestors
- /// and the box itself
- virtual void bbConstructor() {}
- /// System callback which calls bbUserDestructor for all its ancestors
- /// and the box itself
- virtual void bbDestructor() {}
- //==================================================================
+ //==================================================================
+ /// User can redefine this method to set
+ /// the default values of the box inputs and outputs
+ /// (it is called in the box constructor)
+ virtual void bbUserSetDefaultValues() {}
+
+ /// User can redefine this method to initialize what must be
+ /// initialized for the box to work, for example allocate dynamic data.
+ /// It is called once and only once before any call to bbUserCreateWidget
+ /// or bbUserProcess.
+ /// What has been allocated here must be desalocated in
+ /// bbFinalizeProcessing
+ virtual void bbUserInitializeProcessing() {}
+
+ /// User must redefine this method to uninitialize what has been
+ /// initialized in bbUserInitializeProcessing,
+ /// typically desallocate memory that has been allocated dynamically.
+ /// It is called in the box destructor if and only if (iff)
+ /// bbUserInitializeProcessing has been called previously.
+ virtual void bbUserFinalizeProcessing() {}
+
+
+ /// Initializes processing IF NEEDED.
+ /// Calls bbRecursiveInitializeProcessing if the box is in
+ /// "uninitialized" state and put it in "initialized" state.
+ /// On construction, boxes are "uninitialized".
+ /// See also bbFinalizeProcessing
+ void bbInitializeProcessing();
+
+ /// Finalizes processing IF NEEDED.
+ /// Calls bbRecursiveFinalizeProcessing if the box is in
+ /// "initialized" state and put it in "uninitialized" state.
+ /// On construction, boxes are "uninitialized".
+ /// See also bbInitializeProcessing
+ void bbFinalizeProcessing();
+
+ /// Abstract prototype of the method which
+ /// Recursively calls itself for the parent black box and then
+ /// calls bbUserInitializeProcessing for its own class.
+ /// It is redefined in each black box descendant.
+ /// Allows to call bbUserInitializeProcessing for all inherited classes
+ /// (like a constructor does)
+ virtual void bbRecursiveInitializeProcessing() {}
+
+
+ /// Abstract prototype of the method which
+ /// calls bbUserFinalizeProcessing for its own class and then
+ /// recursively calls itself for the parent black box.
+ /// It is redefined in each black box descendant.
+ /// Allows to call bbUserFinalizeProcessing for all inherited classes
+ /// (like a destructor does)
+ virtual void bbRecursiveFinalizeProcessing() {}
+
+ //==================================================================
+
+
//==================================================================
// Common inputs / outputs to all boxes
/// Returns the value of the input "BoxProcessMode"
//==================================================================
// ATTRIBUTES
- /// Is the box "constructed" ? (initialized)
- bool bbmConstructed;
+ /// Is the box initialized ?
+ bool bbmInitialized;
/// Is the box executing ?
bool bbmExecuting;
/// The name of the black-box
Program: bbtk
Module: $RCSfile: bbtkQtBlackBox.cxx,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:11 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2009/05/14 14:43:33 $
+ Version: $Revision: 1.2 $
=========================================================================*/
/* ---------------------------------------------------------------------
}
//==================================================================
+ //==================================================================
+ void QtBlackBox::bbUserSetDefaultValues()
+ {
+ }
+ //==================================================================
+
+ //==================================================================
+ void QtBlackBox::bbUserInitializeProcessing()
+ {
+ }
+ //==================================================================
+ //==================================================================
+ void QtBlackBox::bbUserFinalizeProcessing()
+ {
+ }
+ //==================================================================
//==================================================================
// void QtBlackBox::InitWindowManagerIfNeeded() { Qt::
Program: bbtk
Module: $RCSfile: bbtkVtkBlackBoxMacros.h,v $
Language: C++
- Date: $Date: 2009/04/30 14:31:31 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2009/05/14 14:43:34 $
+ Version: $Revision: 1.10 $
=========================================================================*/
/* ---------------------------------------------------------------------
{ return vtkParent::Get##NAME(); } \
void bbSetInput##NAME (TYPE d) \
{ vtkParent::Set##NAME(d); \
- /*bbSetModifiedStatus();*/ }
+ }
//===========================================================================
+//===========================================================================
+/// 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_2_PARAM(NAME,TYPE) \
+ public: \
+ TYPE bbGetInput##NAME () \
+ {
+ TO DO : HOW TO RECOMPOSE A VECTOR ?
+ { return vtkParent::Get##NAME(); } \
+ void bbSetInput##NAME (TYPE d) \
+ {
+ vtkParent::Set##NAME(d[0],d[1]); \
+}
+*/
+//===========================================================================
//============================================================================
Program: bbtk
Module: $RCSfile: bbtkWidgetBlackBox.h,v $
Language: C++
- Date: $Date: 2009/04/21 14:36:51 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2009/05/14 14:43:34 $
+ Version: $Revision: 1.3 $
========================================================================*/
protected:
- //==================================================================
- /// User callback called in the box contructor
- virtual void bbUserConstructor();
- /// User callback called in the box copy constructor
- virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
- /// User callback called in the box destructor
- virtual void bbUserDestructor();
- //==================================================================
-
-
-
//==================================================================
/// Convenient method for layout widgets which creates and returns
Window* bbmWindow;
- void bbInitAttributes();
};
//=================================================================
Program: bbtk
Module: $RCSfile: bbtkWidgetBlackBox.txx,v $
Language: C++
- Date: $Date: 2009/04/21 14:36:51 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2009/05/14 14:43:34 $
+ Version: $Revision: 1.3 $
=========================================================================*/
/* ---------------------------------------------------------------------
//=========================================================================
template <class T>
- void WidgetBlackBox<T>::bbUserConstructor()
+ void WidgetBlackBox<T>::bbUserSetDefaultValues()
{
- bbtkDebugMessage("widget",9,"WidgetBlackBox::bbUserConstructor()"<<std::endl);
- bbInitAttributes();
+ bbtkDebugMessage("widget",9,"WidgetBlackBox::bbUserSetDefaultValues()"<<std::endl);
+ bbmWindow = 0;
+ bbSetInputWinTitle(bbGetName());
+ bbSetInputWinWidth(800);
+ bbSetInputWinHeight(800);
+ bbSetInputWinDialog(false);
+ bbSetOutputWidget(0);
}
//=========================================================================
+
//=========================================================================
template <class T>
- void WidgetBlackBox<T>::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
+ void WidgetBlackBox<T>::bbUserInitializeProcessing()
{
- bbtkDebugMessage("widget",9,"WidgetBlackBox::bbUserCopyConstructor()"
- <<std::endl);
- bbInitAttributes();
}
//=========================================================================
-
//=========================================================================
template <class T>
- void WidgetBlackBox<T>::bbUserDestructor()
+ void WidgetBlackBox<T>::bbUserFinalizeProcessing()
{
- bbtkDebugMessage("widget",9,"==> WidgetBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
+ bbtkDebugMessage("widget",9,"==> WidgetBlackBox::bbUserFinalizeProcessing() ["<<bbGetFullName()<<"]"<<std::endl);
if (bbGetWindow()) {
bbGetWindow()->bbClose();
bbSetWindow(0);
}
- bbtkDebugMessage("widget",9,"<== WidgetBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
+ bbtkDebugMessage("widget",9,"<== WidgetBlackBox::bbUserFinalizeProcessing() ["<<bbGetFullName()<<"]"<<std::endl);
}
//=========================================================================
- //=========================================================================
- /**
- * \brief Initialize the attributes of the class
- *
- */
- template <class T>
- void WidgetBlackBox<T>::bbInitAttributes()
- {
- bbmWindow = 0;
- bbSetInputWinTitle(bbGetName());
- bbSetInputWinWidth(800);
- bbSetInputWinHeight(800);
- bbSetInputWinDialog(false);
- bbSetOutputWidget(0);
- }
- //=========================================================================
-
+
//=========================================================================
template <class T>
// Cast it into a WidgetBlackBox
typename WidgetBlackBox<T>::Pointer wfrom
= boost::dynamic_pointer_cast<WidgetBlackBox<T> >(from);
- // Call bbCreateWidget
+ // If the black box from construction is not done yet : do it
+ // If not constructed do it
+ wfrom->bbInitializeProcessing();
+ // Call bbUserCreateWidget
wfrom->bbUserCreateWidget(parent);
// Get the widget created
w = wfrom->bbGetOutputWidget();
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.cxx,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:11 $
- Version: $Revision: 1.38 $
+ Date: $Date: 2009/05/14 14:43:34 $
+ Version: $Revision: 1.39 $
=========================================================================*/
/* ---------------------------------------------------------------------
//=========================================================================
//=========================================================================
- void WxBlackBox::bbUserConstructor()
+ void WxBlackBox::bbUserSetDefaultValues()
{
- bbtkDebugMessage("Kernel",9,"WxBlackBox::bbUserConstructor()"<<std::endl);
- bbInitAttributes();
+ bbtkDebugMessage("Kernel",9,"WxBlackBox::bbUserSetDefaultValues()"<<std::endl);
+ bbSetWidgetEventHandler(0);
}
//=========================================================================
//=========================================================================
- void WxBlackBox::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
+ void WxBlackBox::bbUserInitializeProcessing()
{
- bbtkDebugMessage("Kernel",9,"WxBlackBox::bbUserCopyConstructor()"
- <<std::endl);
- bbInitAttributes();
}
- //=========================================================================
-
-
+ //==================================================================
//=========================================================================
- /// Initialize the attributes of the class
- void WxBlackBox::bbInitAttributes()
+ void WxBlackBox::bbUserFinalizeProcessing()
{
- bbSetWidgetEventHandler(0);
}
- //=========================================================================
+ //==================================================================
//==================================================================
/// Callback for creating a Dialog window (modal)
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.h,v $
Language: C++
- Date: $Date: 2009/04/08 07:56:11 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2009/05/14 14:43:34 $
+ Version: $Revision: 1.27 $
========================================================================*/
virtual void bbCreateFrameWindow();
//==================================================================
- //==================================================================
- /// User callback called in the box contructor
- virtual void bbUserConstructor();
- /// User callback called in the box copy constructor
- virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
- //==================================================================
-
+
//==================================================================
// virtual void InitWindowManagerIfNeeded();
{ return bbmWidgetEventHandler; }
/// The WxBlackBoxWidgetEventHandler associated to the box
WxBlackBoxWidgetEventHandler* bbmWidgetEventHandler;
- /// Init the attributes
- void bbInitAttributes();
};
//=================================================================
Program: bbtk
Module: $RCSfile: bbstdASCII.cxx,v $
Language: C++
- Date: $Date: 2008/11/25 11:17:20 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
bbSetOutputOut( result );
}
- void ASCII::bbUserConstructor()
+ void ASCII::bbUserSetDefaultValues()
{
bbSetInputIn("");
bbSetInputType(0);
}
-
- void ASCII::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
- {
+ void ASCII::bbUserInitializeProcessing()
+ {
}
-
- void ASCII::bbUserDestructor()
+ void ASCII::bbUserFinalizeProcessing()
{
- }
+ }
+
}
// EO namespace bbstd
Program: bbtk
Module: $RCSfile: bbstdASCII.h,v $
Language: C++
- Date: $Date: 2008/12/11 15:30:09 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.10 $
=========================================================================*/
/* ---------------------------------------------------------------------
public bbtk::AtomicBlackBox
{
BBTK_BLACK_BOX_INTERFACE(ASCII,bbtk::AtomicBlackBox);
- //==================================================================
- /// User callback called in the box contructor
- virtual void bbUserConstructor();
- /// User callback called in the box copy constructor
- virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
- /// User callback called in the box destructor
- virtual void bbUserDestructor();
- //==================================================================
BBTK_DECLARE_INPUT(In,std::string);
BBTK_DECLARE_INPUT(Type,int);
BBTK_DECLARE_OUTPUT(Out,std::string);
bbSetOutputOut( bbGetInputIn1() + bbGetInputIn2() );
</PRE></process>
- <constructor><PRE>
+ <defaultValues><PRE>
bbSetInputIn1(0);
bbSetInputIn2(0);
bbSetOutputOut(0);
- </PRE></constructor>
+ </PRE></defaultValues>
</blackbox>
Program: bbtk
Module: $RCSfile: bbstdCast.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:20 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_END_DESCRIBE_TEMPLATE2_BLACK_BOX(Cast);
//=================================================================
+ template <class T, class U> void Cast<T,U>::bbUserSetDefaultValues() {}
+ template <class T, class U> void Cast<T,U>::bbUserInitializeProcessing() {}
+ template <class T, class U> void Cast<T,U>::bbUserFinalizeProcessing() {}
+
} // namespace bbstd
Program: bbtk
Module: $RCSfile: bbstdConcatStrings.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:26 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ConcatStrings);
BBTK_BLACK_BOX_IMPLEMENTATION(ConcatStrings,bbtk::AtomicBlackBox);
- void ConcatStrings::bbUserConstructor()
+ void ConcatStrings::bbUserSetDefaultValues()
{
bbSetInputIn1("");
bbSetInputIn2("");
bbSetInputIn10("");
}
+ void ConcatStrings::bbUserInitializeProcessing()
+ {
+ }
+ void ConcatStrings::bbUserFinalizeProcessing()
+ {
+ }
void ConcatStrings::DoProcess()
{
Program: bbtk
Module: $RCSfile: bbstdConcatStrings.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_OUTPUT(Out,std::string);
BBTK_PROCESS(DoProcess);
void DoProcess();
-
- protected:
- virtual void bbUserConstructor();
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ConcatStrings,bbtk::AtomicBlackBox);
Program: bbtk
Module: $RCSfile: bbstdConfiguration.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:26 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,Configuration);
BBTK_BLACK_BOX_IMPLEMENTATION(Configuration,bbtk::AtomicBlackBox);
- void Configuration::bbUserConstructor()
+ void Configuration::bbUserSetDefaultValues()
{
}
-
+ void Configuration::bbUserInitializeProcessing()
+ {
+ }
+ void Configuration::bbUserFinalizeProcessing()
+ {
+ }
+
void Configuration::DoProcess()
{
bbSetOutputBinPath( bbtk::ConfigurationFile::GetInstance().Get_bin_path() );
Program: bbtk
Module: $RCSfile: bbstdConfiguration.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.11 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_PROCESS(DoProcess);
void DoProcess();
- protected:
- virtual void bbUserConstructor();
-
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(Configuration,bbtk::AtomicBlackBox);
bbSetOutputOut( bbGetInputIn1() / bbGetInputIn2() );
</PRE></process>
- <constructor><PRE>
+ <defaultValues><PRE>
bbSetInputIn1(0);
bbSetInputIn2(1);
bbSetOutputOut(0);
- </PRE></constructor>
+ </PRE></defaultValues>
</blackbox>
Program: bbtk
Module: $RCSfile: bbstdExecBbiCommand.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:26 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.11 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ExecBbiCommand);
BBTK_BLACK_BOX_IMPLEMENTATION(ExecBbiCommand,bbtk::AtomicBlackBox);
- void ExecBbiCommand::bbUserConstructor()
+ void ExecBbiCommand::bbUserSetDefaultValues()
{
bbSetInputIn("help");
}
-
+ void ExecBbiCommand::bbUserInitializeProcessing()
+ {
+ }
+ void ExecBbiCommand::bbUserFinalizeProcessing()
+ {
+ }
+
void ExecBbiCommand::DoProcess()
{
Program: bbtk
Module: $RCSfile: bbstdExecBbiCommand.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_INPUT(In,std::string);
BBTK_PROCESS(DoProcess);
void DoProcess();
-
- protected:
- virtual void bbUserConstructor();
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ExecBbiCommand,bbtk::AtomicBlackBox);
Program: bbtk
Module: $RCSfile: bbstdExecSystemCommand.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:26 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ExecSystemCommand);
BBTK_BLACK_BOX_IMPLEMENTATION(ExecSystemCommand,bbtk::AtomicBlackBox);
- void ExecSystemCommand::bbUserConstructor()
+ void ExecSystemCommand::bbUserSetDefaultValues()
{
bbSetInputIn("help");
}
-
+ void ExecSystemCommand::bbUserInitializeProcessing()
+ {
+ }
+ void ExecSystemCommand::bbUserFinalizeProcessing()
+ {
+ }
+
void ExecSystemCommand::DoProcess()
{
bool ok=true;
Program: bbtk
Module: $RCSfile: bbstdExecSystemCommand.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_INPUT(In,std::string)
BBTK_PROCESS(DoProcess);
void DoProcess();
-
- protected:
- virtual void bbUserConstructor();
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ExecSystemCommand,bbtk::AtomicBlackBox);
}
-void FilesFromDirectory::bbUserConstructor()
+void FilesFromDirectory::bbUserSetDefaultValues()
{
bbSetInputIn(".");
bbSetInputRecursive(false);
}
-void FilesFromDirectory::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
-{
-
-
-}
-void FilesFromDirectory::bbUserDestructor()
-{
-
+ void FilesFromDirectory::bbUserInitializeProcessing()
+ {
+ }
+ void FilesFromDirectory::bbUserFinalizeProcessing()
+ {
+ }
-}
-
/**
* \brief Add a SEPARATOR to the end of the name if necessary
* @param pathname file/directory name to normalize
public bbtk::AtomicBlackBox
{
BBTK_BLACK_BOX_INTERFACE(FilesFromDirectory,bbtk::AtomicBlackBox);
- //==================================================================
- /// User callback called in the box contructor
- virtual void bbUserConstructor();
- /// User callback called in the box copy constructor
- virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
- /// User callback called in the box destructor
- virtual void bbUserDestructor();
- //==================================================================
BBTK_DECLARE_INPUT(In,std::string);
BBTK_DECLARE_INPUT(Recursive,bool);
BBTK_DECLARE_OUTPUT(Out,std::vector<std::string>);
Program: bbtk
Module: $RCSfile: bbstdGetVectorElement.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.5 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_OUTPUT(Out,T);
BBTK_PROCESS(DoIt);
void DoIt();
- virtual void bbUserConstructor();
};
//=================================================================
//=================================================================
template <class T>
- void GetVectorElement<T>::bbUserConstructor()
+ void GetVectorElement<T>::bbUserSetDefaultValues()
+ {
+
+ }
+ //=================================================================
+ //=================================================================
+ template <class T>
+ void GetVectorElement<T>::bbUserInitializeProcessing()
+ {
+
+ }
+ //=================================================================
+ //=================================================================
+ template <class T>
+ void GetVectorElement<T>::bbUserFinalizeProcessing()
{
}
Program: bbtk
Module: $RCSfile: bbstdMagicBox.cxx,v $
Language: C++
- Date: $Date: 2009/03/30 14:42:23 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
BlackBox::bbSetStatusAndPropagate(c,s);
}
+ void MagicBox::bbUserSetDefaultValues()
+ {
+ mCanSet = true;
+ }
+ void MagicBox::bbUserInitializeProcessing()
+ {
+ }
+ void MagicBox::bbUserFinalizeProcessing()
+ {
+ }
void MagicBox::DoProcess()
{
mCanSet = true;
Program: bbtk
Module: $RCSfile: bbstdMagicBox.h,v $
Language: C++
- Date: $Date: 2009/03/30 14:42:23 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.12 $
=========================================================================*/
/* ---------------------------------------------------------------------
virtual void bbSetStatusAndPropagate(bbtk::BlackBoxInputConnector* c,
bbtk::IOStatus s);
bool mCanSet;
- virtual void bbUserConstructor() { mCanSet = true; }
-
};
//==================================================================
Program: bbtk
Module: $RCSfile: bbstdMakeFileName.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:27 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.5 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MakeFileName);
BBTK_BLACK_BOX_IMPLEMENTATION(MakeFileName,bbtk::AtomicBlackBox);
- void MakeFileName::bbUserConstructor()
+ void MakeFileName::bbUserSetDefaultValues()
{
bbSetInputDirectory("");
bbSetInputFile("");
bbSetInputExtent("");
}
-
+ void MakeFileName::bbUserInitializeProcessing()
+ {
+ }
+ void MakeFileName::bbUserFinalizeProcessing()
+ {
+ }
+
void MakeFileName::DoProcess()
{
std::string fileSep = bbtk::ConfigurationFile::GetInstance().Get_file_separator();
Program: bbtk
Module: $RCSfile: bbstdMakeFileName.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_OUTPUT(Out, std::string);
BBTK_PROCESS(DoProcess);
void DoProcess();
-
- protected:
- virtual void bbUserConstructor();
-
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(MakeFileName,bbtk::AtomicBlackBox);
bbSetOutputOut( bbGetInputIn1() * bbGetInputIn2() );
</PRE></process>
- <constructor><PRE>
+ <defaultValues><PRE>
bbSetInputIn1(0);
bbSetInputIn2(0);
bbSetOutputOut(0);
- </PRE></constructor>
+ </PRE></defaultValues>
</blackbox>
Program: bbtk
Module: $RCSfile: bbstdRelay.h,v $
Language: C++
- Date: $Date: 2009/01/08 10:18:34 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.10 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(Relay);
//=======================================================================
+ template <class T> void Relay<T>::bbUserSetDefaultValues() {}
+ template <class T> void Relay<T>::bbUserInitializeProcessing() {}
+ template <class T> void Relay<T>::bbUserFinalizeProcessing() {}
+
}
// namespace bbstd
Program: bbtk
Module: $RCSfile: bbstdStringSelect.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:27 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.5 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,StringSelect)
BBTK_BLACK_BOX_IMPLEMENTATION(StringSelect,bbtk::AtomicBlackBox);
- void StringSelect::bbUserConstructor()
+ void StringSelect::bbUserSetDefaultValues()
{
bbSetInputIn(0);
bbSetInputIn0("");
bbSetInputIn8("");
bbSetInputIn9("");
}
+
+ void StringSelect::bbUserInitializeProcessing()
+ {
+ }
-
-
+ void StringSelect::bbUserFinalizeProcessing()
+ {
+ }
+
+
void StringSelect::DoProcess()
{
if (bbGetInputIn()==0) bbSetOutputOut( bbGetInputIn0() );
Program: bbtk
Module: $RCSfile: bbstdStringSelect.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_OUTPUT(Out,std::string);
BBTK_PROCESS(DoProcess);
void DoProcess();
-
- protected:
- virtual void bbUserConstructor();
-
};
//=======================================================================
Program: bbtk
Module: $RCSfile: bbstdStringTo.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_TEMPLATE_OUTPUT(StringTo, Out,"Output",T);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringTo);
//=================================================================
-
+
+ template <class T> void StringTo<T>::bbUserSetDefaultValues() {}
+ template <class T> void StringTo<T>::bbUserInitializeProcessing() {}
+ template <class T> void StringTo<T>::bbUserFinalizeProcessing() {}
+
+
} // namespace bbstd
#endif // __bbstdStringTo_h_INCLUDED__
Program: bbtk
Module: $RCSfile: bbstdStringToVector.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.10 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector);
//=================================================================
+
+ template <class T> void StringToVector<T>::bbUserSetDefaultValues() {}
+ template <class T> void StringToVector<T>::bbUserInitializeProcessing() {}
+ template <class T> void StringToVector<T>::bbUserFinalizeProcessing() {}
//=================================================================
template <class T>
void StringToVector<T>::DoIt()
Program: bbtk
Module: $RCSfile: bbstdToString.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_TEMPLATE_OUTPUT(ToString, Out,"Output",std::string);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(ToString);
//=================================================================
+
+ template <class T> void ToString<T>::bbUserSetDefaultValues() {}
+ template <class T> void ToString<T>::bbUserInitializeProcessing() {}
+ template <class T> void ToString<T>::bbUserFinalizeProcessing() {}
} // namespace bbstd
Program: bbtk
Module: $RCSfile: bbstdVectorToString.h,v $
Language: C++
- Date: $Date: 2008/12/12 08:55:21 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2009/05/14 14:43:38 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_OUTPUT(Out,std::string);
BBTK_PROCESS(DoIt);
void DoIt();
- virtual void bbUserConstructor();
};
//=================================================================
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(VectorToString);
//=================================================================
- //=================================================================
+ //=================================================================
template <class T>
void VectorToString<T>::DoIt()
{
//=================================================================
template <class T>
- void VectorToString<T>::bbUserConstructor()
+ void VectorToString<T>::bbUserSetDefaultValues()
{
bbSetInputSeparator(" ");
}
//=================================================================
-
+ template <class T>
+ void VectorToString<T>::bbUserInitializeProcessing()
+ {
+ }
+ //=================================================================
+ template <class T>
+ void VectorToString<T>::bbUserFinalizeProcessing()
+ {
+ }
+ //=================================================================
} // namespace bbstd
#endif //__bbstdVectorToString_INCLUDED_h__
</process>
<!--=====================================================================-->
- <!--========================================================================
- CONSTRUCTORS / DESTRUCTORS (OPTIONAL)
- THE CONSTRUCTION METHOD BODY : -->
- <constructor>
+
+ <defaultValues>
<PRE>
bbSetInputIn(1000);
</PRE>
- </constructor>
-
- <!-- THE COPY-CONSTRUCTION METHOD BODY :
- Here does nothing
- But this is where you should allocate the output pointers if any
- and copy the pointed values (to avoid bug caused by multiple references)-->
- <copyconstructor>
- <PRE>
- </PRE>
- </copyconstructor>
+ </defaultValues>
- <!-- THE DESTRUCTION METHOD BODY :
- Here does nothing
- but this is where you should desallocate the output pointers if any -->
- <destructor>
- <PRE>
- </PRE>
- </destructor>
<!--=====================================================================-->
<!--=======================================================================-->
SetCenter(bbGetInputCenterX(),
bbGetInputCenterY(),
bbGetInputCenterZ());
-SetPhiResolution(bbGetInputPhiResolution());
-SetRadius((double)bbGetInputRadius());
-SetThetaResolution(bbGetInputThetaResolution());
Update();
</PRE>
</process>