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