+ //==================================================================
+ /// 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() {}
+ //==================================================================
+
+ //@}
+ //==================================================================
+
+ private:
+ //==================================================================
+ friend class Connection;
+ friend class ComplexBlackBox;
+
+ /// Sets the parent of the BlackBox
+ void bbSetParent(BlackBox::Pointer p) { bbmParent = p; }
+
+ //==================================================================
+ /// @name Input/output connection/disconnection
+ /// INTERNAL METHODS used by a Connection to connect/disconnect
+ /// itself to the i/o connectors of the box
+ //@{
+
+ /// Connects the input <name> to the connection c
+ virtual void bbConnectInput( const std::string& name, Connection* c);
+ /// Connects the output <name> to the connection c
+ virtual void bbConnectOutput( const std::string& name, Connection* c);
+ /// Disconnects the input <name> from the connection c
+ virtual void bbDisconnectInput( const std::string& name, Connection* c);
+ /// Disconnects the output <name> from the connection c
+ virtual void bbDisconnectOutput( const std::string& name, Connection* c);
+ //@}
+ //==================================================================
+
+ /// Returns true if the box can "react",
+ /// which means execute in response to an input change
+ virtual bool bbCanReact() const;
+
+ /// Returns true iff the box is executing
+ bool bbGetExecuting() const { return bbmExecuting; }
+ /// Sets the bbmExecuting bool returned by bbGetExecuting
+ void bbSetExecuting(bool b) { bbmExecuting = b; }
+
+ //==================================================================
+ protected:
+
+
+ //==================================================================
+ /// Black box objects have a special deleter
+ /// which must take care of releasing the descriptor
+ /// **AFTER** the box is deleted
+ /// (Releasing it in the destructor may cause dl close and crash)
+ /// Black box deleter