X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBox.h;h=939b5f8d56d9e3138327ae2ba25a40a2005a48bf;hb=6ac9074f717f22c4ffdc6a70d0704c1b1f8fe842;hp=83c27b3e3f2049ba2f8b7d0ed67969582af3e6a5;hpb=763b880f0a4a18990247eac5750f5a61de36793b;p=bbtk.git diff --git a/kernel/src/bbtkBlackBox.h b/kernel/src/bbtkBlackBox.h index 83c27b3..939b5f8 100644 --- a/kernel/src/bbtkBlackBox.h +++ b/kernel/src/bbtkBlackBox.h @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBox.h,v $ Language: C++ - Date: $Date: 2009/06/11 09:51:42 $ - Version: $Revision: 1.28 $ + Date: $Date: 2011/03/03 14:33:13 $ + Version: $Revision: 1.32 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -63,15 +63,12 @@ namespace bbtk { - struct Void { Void(int = 0) {} }; class Factory; class Connection; class BlackBoxOutputConnector; - - class BBTK_EXPORT BlackBox : public Object { BBTK_ABSTRACT_OBJECT_INTERFACE(BlackBox); @@ -296,13 +293,15 @@ namespace bbtk /// Sets the value of the input 'BoxProcessMode' void bbSetInputBoxProcessMode(std::string a) { bbmBoxProcessMode = a; } /// The possible values of the input 'BoxProcessMode' - typedef enum - { - Pipeline, - Always, - Reactive - } + + typedef enum + { + bbPipeline, + bbAlways, + bbReactive + } BoxProcessModeValue; + /// Returns the "decoded" value of the input "BoxProcessMode" BoxProcessModeValue bbGetBoxProcessModeValue() const; /// Returns true iff the input 'BoxProcessMode' is set to 'Reactive' (or a synonym) @@ -322,9 +321,6 @@ namespace bbtk //@} //================================================================== - - - virtual void bbPrintHelp(BlackBox::Pointer parentblackbox, int detail, int level ); @@ -365,14 +361,11 @@ namespace bbtk protected: - - //================================================================== /// @name User redefinable methods /// Virtual methods which can be redefined by inherited classes //@{ - //================================================================== /// User can redefine this method to set /// the default values of the box inputs and outputs @@ -401,8 +394,6 @@ namespace bbtk //================================================================== - - //================================================================== /// Write Graphviz-dot description in file. @@ -423,16 +414,11 @@ namespace bbtk bool inputoutput, int detail, int level); - - virtual BlackBox::Pointer bbFindBlackBox(const std::string &blackboxname) - { return BlackBox::Pointer();} + { return BlackBox::Pointer();} virtual void Check(bool recursive = true); - - - //================================================================== // PROTECTED PART : ACCESSIBLE TO THE BlackBox DEVELOPER // (IN INHERITED CLASSES) @@ -558,8 +544,6 @@ namespace bbtk //@} //================================================================== - - private: //================================================================== friend class Connection; @@ -593,17 +577,11 @@ namespace bbtk /// 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: //================================================================== @@ -639,7 +617,10 @@ namespace bbtk /// The default implementation is to issue 'delete this' /// but it can be redefined in inherited classes to handle special deletion mechanisms (e.g. ref counting, private destructors, such as vtk objects deletion with method Delete, etc.). /// \return The number of remaining references on the object after the call (if meaningfull...): used by bbtk to warn a user if another smart pointing system is still holding the object... - virtual int bbDelete() { delete this; return 0; } + +//JCP 21-09-20 09 delete this throws and exception change due to compiler version changing and boost version + virtual int bbDelete() { delete this; + return 0; } //================================================================== @@ -674,22 +655,14 @@ namespace bbtk /// Map that contains the input connectors of the black box InputConnectorMapType mInputConnectorMap; //================================================================== - - }; // Class BlackBox - /// Convenient macro to create output observer callbacks (freehand functions) from object and method pointer (see samples/SampleOutputObserver) #define BBTK_MAKE_OUTPUT_OBSERVER(OBJECT,METHOD) \ boost::bind( METHOD, OBJECT, _1, _2, _3) - - - - } // namespace bbtk #endif -