#include <bbtkAtomicBlackBox.h>
Common inputs / outputs to all boxes | |
std::string | bbGetInputBoxProcessMode () |
Returns the value of the input 'BoxProcessMode'. | |
void | bbSetInputBoxProcessMode (std::string a) |
Sets the value of the input 'BoxProcessMode'. | |
BoxProcessModeValue | bbGetBoxProcessModeValue () const |
Returns the "decoded" value of the input "BoxProcessMode". | |
virtual bool | bbBoxProcessModeIsReactive () const |
Returns true iff the input 'BoxProcessMode' is set to 'Reactive' (or a synonym). | |
virtual bool | bbBoxProcessModeIsAlways () const |
Returns true iff the input 'BoxProcessMode' is set to 'Always' (or a synonym). | |
Void | bbGetInputBoxExecute () |
Returns the value of the input 'BoxExecute'. | |
void | bbSetInputBoxExecute (Void=0) |
Sets the value of the input 'BoxExecute'. | |
Void | bbGetOutputBoxChange () |
Returns the value of the output 'BoxChange'. | |
void | bbSetOutputBoxChange (Void=0) |
Sets the value of the output 'BoxChange'. | |
enum | BoxProcessModeValue { bbPipeline, bbAlways, bbReactive } |
The possible values of the input 'BoxProcessMode'. More... | |
Public Types | |
typedef BlackBox | Self |
typedef boost::shared_ptr< Self > | Pointer |
typedef boost::weak_ptr< Self > | WeakPointer |
typedef boost::signals::trackable | OutputChangeObserverType |
typedef boost::signal< void(bbtk::BlackBox::Pointer, const std::string &, IOStatus)> | OutputChangeSignalType |
typedef OutputChangeSignalType::slot_function_type | OutputChangeCallbackType |
typedef std::map< std::string, BlackBoxOutputConnector * > | OutputConnectorMapType |
The type of map of output connector pointers. | |
typedef std::map< std::string, BlackBoxInputConnector * > | InputConnectorMapType |
The type of map of input connector pointers. | |
Public Member Functions | |
bbtk::BlackBoxDescriptor::Pointer | bbGetDescriptor () const |
Returns the pointer on the descriptor of the box. | |
Data | bbGetOutput (const std::string &label) |
Gets the output Data of a given label. | |
Data | bbGetInput (const std::string &label) |
Gets the input Data of a given label. | |
void | bbSetOutput (const std::string &name, Data data) |
Sets the data of the output called <name>. | |
void | bbSetInput (const std::string &name, Data data, bool setModified=true) |
Sets the data of the input called <name>. | |
void | bbBruteForceSetInputPointer (const std::string &name, void *data, bool setModified=true) |
Sets the data of the input called <name>. | |
std::string | GetObjectInfo () const |
size_t | GetObjectSize () const |
size_t | GetObjectRecursiveSize () const |
virtual BlackBox::Pointer | bbClone (const std::string &name)=0 |
Returns a pointer on a clone of the box with name <name>. | |
virtual void | bbGetHelp (bool full=true) const |
Prints the Help on the BlackBox type. | |
virtual void | bbPrintHelp (BlackBox::Pointer parentblackbox, int detail, int level) |
void | bbInsertHTMLGraph (std::ofstream &s, int detail, int level, bool instanceOrtype, const std::string &output_dir, bool relative_link) |
Does nothing here : overloaded in ComplexBlackBox. | |
virtual std::string | GetObjectName () const |
virtual size_t | GetObjectInternalSize () const |
long | GetUseCount () |
Pipeline processing methods | |
Methods which participate to pipeline processing. | |
virtual void | bbExecute (bool force=false) |
Main processing method of the box. | |
General accessors | |
Methods which give access to general informations on the box | |
const std::string & | bbGetTypeName () const |
Returns the Name of the Type of the BlackBox. | |
const std::string & | bbGetName () const |
Returns the name of the BlackBox (instance). | |
virtual std::string | bbGetFullName () const |
Returns the full name of the BlackBox (instance+type). | |
virtual std::string | bbGetNameWithParent () const |
Returns the name with the name of the parent prepended if any. | |
BlackBox::Pointer | bbGetParent () const |
Returns the parent of the BlackBox, i.e the BlackBox that contains it (0 if none). | |
Inputs/Outputs related methods | |
Methods related to the box inputs and outputs | |
virtual bool | bbHasInput (const std::string &label) const |
Returns true iff the BlackBox has an input of name label. | |
virtual TypeInfo | bbGetInputType (const std::string &label) const |
Gets the input type of a given label. | |
IOStatus | bbGetInputStatus (const std::string &name) const |
Gets the status of the input called <name>. | |
std::string | bbGetInputAsString (const std::string &input) |
Gets the data of the input called <name> as a string using an Adaptor if possible (else returns empty string). | |
virtual bool | bbHasOutput (const std::string &label) const |
Returns true iff the BlackBox has an output of name label. | |
virtual TypeInfo | bbGetOutputType (const std::string &label) const |
Gets the output type of a given label. | |
std::string | bbGetOutputAsString (const std::string &output) |
Gets the data of the output called <name> as a string using an Adaptor if possible (else returns empty string). | |
InputConnectorMapType & | bbGetInputConnectorMap () |
Returns the input connectors map. | |
const InputConnectorMapType & | bbGetInputConnectorMap () const |
Returns the input connectors map (const). | |
BlackBoxInputConnector & | bbGetInputConnector (const std::string &n) |
Returns the input connector. | |
const BlackBoxInputConnector & | bbGetInputConnector (const std::string &n) const |
Returns the input connector (const). | |
OutputConnectorMapType & | bbGetOutputConnectorMap () |
Returns the output connectors map. | |
const OutputConnectorMapType & | bbGetOutputConnectorMap () const |
Returns the output connectors map (const). | |
BlackBoxOutputConnector & | bbGetOutputConnector (const std::string &n) |
Returns the output connector. | |
const BlackBoxOutputConnector & | bbGetOutputConnector (const std::string &n) const |
Returns the output connector (const). | |
Output signals / observers related methods | |
Methods related to signals emitted by outputs and the | |
void | bbAddOutputObserver (const std::string &output_name, OutputChangeCallbackType f) |
void | bbRemoveOutputObserver (const std::string &output_name, OutputChangeCallbackType f) |
virtual void | bbSignalOutputModification (bool reaction=true) |
virtual void | bbSignalOutputModification (const std::string &output_name, bool reaction=true) |
virtual void | bbSignalOutputModification (const std::vector< std::string > &output_name, bool reaction=true) |
Window related methods | |
virtual void | bbSetShown (bool) |
virtual bool | bbIsShown () |
Static Public Member Functions | |
static void | InsertInObjectList (Pointer) |
static void | RemoveFromObjectList (WeakPointer) |
static void | InsertInPackageList (Pointer) |
static void | ReleasePackages () |
static void | PrintObjectListInfo (const std::string &name) |
static void | PrintObjectInfo (const Pointer &o) |
static long | GetObjectsCount () |
Manage the execution | |
static bool | bbGlobalGetSomeBoxExecuting () |
static void | bbGlobalSetSomeBoxExecuting (bool b) |
static void | bbGlobalSetFreezeExecution (bool b) |
static bool | bbGlobalGetFreezeExecution () |
static void | bbGlobalAddToExecutionList (BlackBox::Pointer b) |
static void | bbGlobalProcessExecutionList () |
Protected Member Functions | |
AtomicBlackBox (const std::string &name, bool alloc=true) | |
Constructor with the AtomicBlackBox's instance name. | |
AtomicBlackBox (AtomicBlackBox &from, const std::string &name, bool alloc=true) | |
Constructor from an existing box (copy) with a new instance name. | |
virtual | ~AtomicBlackBox () |
Destructor. | |
virtual void | bbLockDescriptor ()=0 |
virtual void | bbProcess () |
virtual void | bbUserProcess () |
virtual int | bbUserConstructor () |
virtual int | bbUserCopyConstructor (bbtk::BlackBox::Pointer) |
virtual int | bbUserDestructor () |
virtual void | bbWriteDotFileBlackBox (FILE *ff, BlackBox::Pointer parentblackbox, int detail, int level, bool instanceOrtype, bool relative_link) |
Write Graphviz-dot description in file. | |
virtual void | bbWriteDotInputOutputName (FILE *ff, bool inputoutput, int detail, int level) |
Auxiliary method for bbWriteDotFileBlackBox. | |
virtual BlackBox::Pointer | bbFindBlackBox (const std::string &blackboxname) |
virtual void | Check (bool recursive=true) |
virtual void | bbSetStatusAndPropagate (BlackBoxInputConnector *c, IOStatus s) |
virtual int | bbDelete () |
void | LockThis () |
void | UnLockThis () |
template<class U > | |
boost::shared_ptr< U > | GetThisPointer () const |
User redefinable methods | |
Virtual methods which can be redefined by inherited classes | |
virtual void | bbUserSetDefaultValues () |
virtual void | bbUserInitializeProcessing () |
virtual void | bbUserFinalizeProcessing () |
virtual void | bbUserOnShow () |
Pipeline processing methods | |
Methods which participate to pipeline processing. | |
virtual void | bbRecursiveExecute (Connection::Pointer caller) |
IOStatus | bbUpdateInputs () |
virtual void | bbCreateWindow () |
virtual void | bbShowWindow () |
void | bbComputePostProcessStatus () |
Computes the final IOStatus of inputs and outputs after processing. | |
Box con(des)struction / initi(fin)alization methods | |
virtual void | bbAllocateConnectors () |
Allocates the i/o connectors of the black box. | |
virtual void | bbDesallocateConnectors () |
Desallocates the i/o connectors of the black box. | |
virtual void | bbCopyIOValues (BlackBox &from) |
Copies the values of the inputs/output from the BlackBox from. | |
void | bbInitializeProcessing () |
void | bbFinalizeProcessing () |
virtual void | bbRecursiveInitializeProcessing () |
virtual void | bbRecursiveFinalizeProcessing () |
Static Protected Member Functions | |
template<class U > | |
static boost::shared_ptr< U > | MakeBlackBoxPointer (U *s, bool lock=false) |
Like Object::MakePointer but returns a boost::shared_pointer which uses a BlackBox::Deleter to delete the object instead of the default Object::Deleter. | |
template<class U > | |
static boost::shared_ptr< U > | MakePointer (U *s, bool lock=false) |
template<class U , class D > | |
static boost::shared_ptr< U > | MakePointer (U *s, const D &del, bool lock=false) |
Protected Attributes | |
bbtk::BlackBoxDescriptor::Pointer | bbmDescriptorPointer |
Private Member Functions | |
AtomicBlackBox () | |
Friends | |
struct | Object::Deleter |
Definition at line 52 of file bbtkAtomicBlackBox.h.
typedef std::map<std::string, BlackBoxInputConnector*> bbtk::BlackBox::InputConnectorMapType [inherited] |
typedef OutputChangeSignalType::slot_function_type bbtk::BlackBox::OutputChangeCallbackType [inherited] |
Definition at line 87 of file bbtkBlackBox.h.
typedef boost::signals::trackable bbtk::BlackBox::OutputChangeObserverType [inherited] |
Definition at line 74 of file bbtkBlackBox.h.
typedef boost::signal<void (bbtk::BlackBox::Pointer, const std::string&, IOStatus)> bbtk::BlackBox::OutputChangeSignalType [inherited] |
Definition at line 85 of file bbtkBlackBox.h.
typedef std::map<std::string, BlackBoxOutputConnector*> bbtk::BlackBox::OutputConnectorMapType [inherited] |
typedef boost::shared_ptr<Self> bbtk::BlackBox::Pointer [inherited] |
Reimplemented from bbtk::Object.
Reimplemented in bbtk::ComplexBlackBox, bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 74 of file bbtkBlackBox.h.
typedef BlackBox bbtk::BlackBox::Self [inherited] |
Reimplemented in bbtk::ComplexBlackBox, bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 74 of file bbtkBlackBox.h.
typedef boost::weak_ptr<Self> bbtk::BlackBox::WeakPointer [inherited] |
Reimplemented from bbtk::Object.
Reimplemented in bbtk::ComplexBlackBox, bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 74 of file bbtkBlackBox.h.
enum bbtk::BlackBox::BoxProcessModeValue [inherited] |
The possible values of the input 'BoxProcessMode'.
Definition at line 297 of file bbtkBlackBox.h.
00298 { 00299 bbPipeline, 00300 bbAlways, 00301 bbReactive 00302 }
bbtk::AtomicBlackBox::AtomicBlackBox | ( | const std::string & | name, | |
bool | alloc = true | |||
) | [protected] |
Constructor with the AtomicBlackBox's instance name.
Definition at line 42 of file bbtkAtomicBlackBox.cxx.
References bbtkBlackBoxDebugMessage.
00043 : BlackBox(name) 00044 { 00045 bbtkBlackBoxDebugMessage("object",3, 00046 "==> AtomicBlackBox(\"" 00047 <<name<<"\")"<<std::endl); 00048 }
bbtk::AtomicBlackBox::AtomicBlackBox | ( | AtomicBlackBox & | from, | |
const std::string & | name, | |||
bool | alloc = true | |||
) | [protected] |
Constructor from an existing box (copy) with a new instance name.
Constructor from an existing box (copy) with a new name.
Definition at line 53 of file bbtkAtomicBlackBox.cxx.
References bbtk::BlackBox::bbGetFullName(), and bbtkBlackBoxDebugMessage.
00056 : BlackBox(from,name) 00057 { 00058 bbtkBlackBoxDebugMessage("object",3, 00059 "==> AtomicBlackBox(" 00060 <<from.bbGetFullName()<<",\"" 00061 <<name<<"\")"<<std::endl); 00062 }
bbtk::AtomicBlackBox::~AtomicBlackBox | ( | ) | [protected, virtual] |
Destructor.
Definition at line 68 of file bbtkAtomicBlackBox.cxx.
References bbtkBlackBoxDebugMessage.
00069 { 00070 bbtkBlackBoxDebugMessage("object",3,"==> ~AtomicBlackBox()" 00071 <<std::endl); 00072 bbtkBlackBoxDebugMessage("object",3,"<== ~AtomicBlackBox()" 00073 <<std::endl); 00074 }
bbtk::AtomicBlackBox::AtomicBlackBox | ( | ) | [inline, private] |
Default constructor is private : derived classes must use the constructor with the AtomicBlackBox's name
Definition at line 138 of file bbtkAtomicBlackBox.h.
00138 : BlackBox("") {}
void bbtk::BlackBox::bbAddOutputObserver | ( | const std::string & | output_name, | |
OutputChangeCallbackType | f | |||
) | [inherited] |
Adds the function f to the list of functions to call when the output changes. f is of type ChangeCallbackType which is basically: void (*ChangeCallbackType)(bbtk::BlackBox::Pointer, const std::string&, bbtk::IOStatus) To pass a member function 'f' of an instance 'c' of a class 'C' as callback you have to 'bind' it, i.e. call: bbAddOutputObserver ( "Out", boost::bind( &C::f , c, _1, _2, _3 ) ); The convenience macro BBTK_BIND_OUTPUT_OBSERVER ( c, C::f ) does it for you
Definition at line 409 of file bbtkBlackBox.cxx.
References bbtk::BlackBoxOutputConnector::AddChangeObserver(), and bbtk::BlackBox::bbGetOutputConnector().
00411 { 00412 bbGetOutputConnector(output).AddChangeObserver(f); 00413 }
void bbtk::BlackBox::bbAllocateConnectors | ( | ) | [protected, virtual, inherited] |
Allocates the i/o connectors of the black box.
Reimplemented in bbtk::ComplexBlackBox.
Definition at line 256 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), bbtk::BlackBox::bbGetInputConnectorMap(), bbtk::BlackBox::bbGetOutputConnectorMap(), bbtkBlackBoxDebugMessage, bbtk::i, and bbtk::BlackBox::MakeBlackBoxPointer().
00257 { 00258 bbtkBlackBoxDebugMessage("kernel",8, 00259 "BlackBox::bbAllocateConnectors()" 00260 <<std::endl); 00261 00262 MakeBlackBoxPointer(this,true); 00263 00264 const BlackBoxDescriptor::InputDescriptorMapType& imap 00265 = bbGetDescriptor()->GetInputDescriptorMap(); 00266 BlackBoxDescriptor::InputDescriptorMapType::const_iterator i; 00267 for ( i = imap.begin(); i != imap.end(); ++i ) 00268 { 00269 bbtkBlackBoxDebugMessage("kernel",8,"* Allocate \""<<i->first<<"\""<<std::endl); 00270 bbGetInputConnectorMap()[i->second->GetName()] 00271 = new BlackBoxInputConnector(GetThisPointer<BlackBox>()); 00272 } 00273 const BlackBoxDescriptor::OutputDescriptorMapType& omap 00274 = bbGetDescriptor()->GetOutputDescriptorMap(); 00275 BlackBoxDescriptor::OutputDescriptorMapType::const_iterator o; 00276 for ( o = omap.begin(); o != omap.end(); ++o ) 00277 { 00278 bbtkBlackBoxDebugMessage("kernel",8,"* Allocate \""<<o->first<<"\""<<std::endl); 00279 bbGetOutputConnectorMap()[o->second->GetName()] 00280 = new BlackBoxOutputConnector(GetThisPointer<BlackBox>()); 00281 } 00282 }
bool bbtk::BlackBox::bbBoxProcessModeIsAlways | ( | ) | const [virtual, inherited] |
Returns true iff the input 'BoxProcessMode' is set to 'Always' (or a synonym).
Definition at line 399 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbAlways, and bbtk::BlackBox::bbGetBoxProcessModeValue().
Referenced by bbtk::BlackBox::bbComputePostProcessStatus(), and bbtk::BlackBox::bbRecursiveExecute().
00400 { 00401 return (bbGetBoxProcessModeValue() == bbAlways); 00402 }
bool bbtk::BlackBox::bbBoxProcessModeIsReactive | ( | ) | const [virtual, inherited] |
Returns true iff the input 'BoxProcessMode' is set to 'Reactive' (or a synonym).
Definition at line 392 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetBoxProcessModeValue(), and bbtk::BlackBox::bbReactive.
Referenced by bbtk::BlackBox::bbSetStatusAndPropagate().
00393 { 00394 return (bbGetBoxProcessModeValue() == bbReactive); 00395 }
void bbtk::AtomicBlackBox::bbBruteForceSetInputPointer | ( | const std::string & | name, | |
void * | data, | |||
bool | setModified = true | |||
) | [virtual] |
Sets the data of the input called <name>.
Implements bbtk::BlackBox.
Definition at line 149 of file bbtkAtomicBlackBox.cxx.
References bbGetDescriptor(), bbtk::BlackBox::bbGetInputConnectorMap(), bbtk::BlackBox::bbSetStatusAndPropagate(), bbtkBlackBoxDebugMessage, and bbtk::MODIFIED.
00153 { 00154 bbtkBlackBoxDebugMessage("data",7, 00155 "AtomicBlackBox::bbBruteForceSetInputPointer(\"" 00156 <<name<<"\",data)" 00157 <<std::endl); 00158 ((AtomicBlackBoxInputDescriptor*)bbGetDescriptor() 00159 ->GetInputDescriptor(name))->GetSetFunctor() 00160 ->BruteForceSetPointer(this,data); 00161 00162 if (setModified) 00163 { 00164 bbSetStatusAndPropagate(bbGetInputConnectorMap().find(name)->second, 00165 MODIFIED); 00166 } 00167 00168 }
virtual BlackBox::Pointer bbtk::BlackBox::bbClone | ( | const std::string & | name | ) | [pure virtual, inherited] |
Returns a pointer on a clone of the box with name <name>.
Implemented in bbtk::ComplexBlackBox, bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
void bbtk::BlackBox::bbComputePostProcessStatus | ( | ) | [protected, inherited] |
Computes the final IOStatus of inputs and outputs after processing.
Definition at line 779 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbBoxProcessModeIsAlways(), bbtk::BlackBox::bbGetInputConnectorMap(), bbtk::BlackBox::bbGetOutputConnectorMap(), bbtkBlackBoxDebugMessage, bbtk::GetIOStatusString(), bbtk::i, bbtk::MODIFIED, bbtk::OUTOFDATE, and bbtk::UPTODATE.
Referenced by bbtk::BlackBox::bbRecursiveExecute().
00780 { 00781 bbtkBlackBoxDebugMessage("process",4, 00782 "=> BlackBox::bbComputePostProcessStatus()" 00783 <<std::endl); 00784 00785 IOStatus new_output_status = UPTODATE; 00786 if (bbBoxProcessModeIsAlways()) new_output_status = OUTOFDATE; 00787 00788 // Update the input statuses 00789 InputConnectorMapType::iterator i; 00790 for ( i = bbGetInputConnectorMap().begin(); 00791 i!= bbGetInputConnectorMap().end(); ++i) 00792 { 00793 IOStatus t = i->second->GetStatus(); 00794 if (t == OUTOFDATE) new_output_status = OUTOFDATE; 00795 // A previously MODIFIED status turns to UPTODATE 00796 if (t==MODIFIED) i->second->SetStatus(UPTODATE); 00797 bbtkBlackBoxDebugMessage("change",2, 00798 "Input '"<<i->first<<"' : " 00799 << GetIOStatusString(t) << " -> " 00800 << GetIOStatusString(i->second->GetStatus()) 00801 << std::endl); 00802 } 00803 bbtkBlackBoxDebugMessage("change",2, 00804 "New output status : " 00805 << GetIOStatusString(new_output_status) 00806 <<std::endl); 00807 // Update the output statuses 00808 OutputConnectorMapType::iterator o; 00809 for ( o = bbGetOutputConnectorMap().begin(); 00810 o!= bbGetOutputConnectorMap().end(); ++o) 00811 { 00812 o->second->SetStatus(new_output_status); 00813 } 00814 00815 bbtkBlackBoxDebugMessage("process",4, 00816 "<= BlackBox::bbComputePostProcessStatus()" 00817 <<std::endl); 00818 }
void bbtk::BlackBox::bbCopyIOValues | ( | BlackBox & | from | ) | [protected, virtual, inherited] |
Copies the values of the inputs/output from the BlackBox from.
Definition at line 314 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), bbtk::BlackBox::bbGetFullName(), bbtk::BlackBox::bbGetInput(), bbtk::BlackBox::bbGetOutput(), bbtk::BlackBox::bbSetInput(), bbtk::BlackBox::bbSetOutput(), bbtkBlackBoxDebugMessage, bbtkDebugDecTab, and bbtk::i.
00315 { 00316 bbtkBlackBoxDebugMessage("kernel",1, 00317 "BlackBox::bbCopyIOValues(" 00318 <<from.bbGetFullName()<<")" 00319 <<std::endl); 00320 // copies the input values 00321 const BlackBoxDescriptor::InputDescriptorMapType& imap 00322 = bbGetDescriptor()->GetInputDescriptorMap(); 00323 BlackBoxDescriptor::InputDescriptorMapType::const_iterator i; 00324 for ( i = imap.begin(); i != imap.end(); ++i ) 00325 { 00326 if (! i->second->GetCopyConstruct() ) continue; 00327 std::string input = i->second->GetName(); 00328 bbtkBlackBoxDebugMessage("kernel",2,"* Copying input "<<input<<std::endl); 00329 this->bbSetInput(input, from.bbGetInput(input) ); 00330 } 00331 // copies the output values 00332 const BlackBoxDescriptor::OutputDescriptorMapType& omap 00333 = bbGetDescriptor()->GetOutputDescriptorMap(); 00334 BlackBoxDescriptor::OutputDescriptorMapType::const_iterator o; 00335 for ( o = omap.begin(); o != omap.end(); ++o ) 00336 { 00337 if (! o->second->GetCopyConstruct() ) continue; 00338 std::string output = o->second->GetName(); 00339 bbtkBlackBoxDebugMessage("kernel",2,"* Copying output "<<output<<std::endl); 00340 this->bbSetOutput(output, from.bbGetOutput(output) ); 00341 } 00342 00343 bbtkDebugDecTab("kernel",9); 00344 }
virtual void bbtk::BlackBox::bbCreateWindow | ( | ) | [inline, protected, virtual, inherited] |
Actual CreateWindow method (vitual) Overloaded in AtomicBlacBox and descendants
Reimplemented in bbtk::WidgetBlackBox< W >, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 455 of file bbtkBlackBox.h.
Referenced by bbtk::BlackBox::bbRecursiveExecute().
virtual int bbtk::BlackBox::bbDelete | ( | ) | [inline, protected, virtual, inherited] |
Effective deletion method called by the Deleter. 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.).
Definition at line 622 of file bbtkBlackBox.h.
Referenced by bbtk::BlackBox::Deleter::Delete().
void bbtk::BlackBox::bbDesallocateConnectors | ( | ) | [protected, virtual, inherited] |
Desallocates the i/o connectors of the black box.
Reimplemented in bbtk::ComplexBlackBox.
Definition at line 287 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetInputConnectorMap(), bbtk::BlackBox::bbGetOutputConnectorMap(), bbtkBlackBoxDebugMessage, bbtkDebugDecTab, and bbtk::i.
Referenced by bbtk::BlackBox::~BlackBox().
00288 { 00289 bbtkBlackBoxDebugMessage("kernel",8, 00290 "BlackBox::bbDesallocateConnectors()" 00291 <<std::endl); 00292 00293 InputConnectorMapType::const_iterator i; 00294 for ( i = bbGetInputConnectorMap().begin(); 00295 i != bbGetInputConnectorMap().end(); ++i ) 00296 { 00297 bbtkBlackBoxDebugMessage("kernel",8,"* Delete \""<<i->first<<"\""<<std::endl); 00298 delete (i->second); 00299 } 00300 OutputConnectorMapType::const_iterator o; 00301 for ( o = bbGetOutputConnectorMap().begin(); 00302 o != bbGetOutputConnectorMap().end(); ++o ) 00303 { 00304 bbtkBlackBoxDebugMessage("kernel",8,"* Delete \""<<o->first<<"\""<<std::endl); 00305 delete (o->second); 00306 } 00307 00308 bbtkDebugDecTab("kernel",8); 00309 }
void bbtk::BlackBox::bbExecute | ( | bool | force = false |
) | [virtual, inherited] |
Main processing method of the box.
Reimplemented in bbtk::ComplexBlackBox.
Definition at line 594 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGlobalGetFreezeExecution(), bbtk::BlackBox::bbRecursiveExecute(), BBTK_BUSY_CURSOR, and bbtkBlackBoxDebugMessage.
00595 { 00596 bbtkBlackBoxDebugMessage("process",2, 00597 "=> BlackBox::bbExecute("<<(int)force<<")" 00598 <<std::endl); 00599 00600 // If already executing : return 00601 /* 00602 if (bbGetExecuting()) 00603 { 00604 bbtkBlackBoxDebugMessage("process",2, 00605 " -> already executing : abort"<<std::endl); 00606 return; 00607 } 00608 */ 00609 00610 // If execution frozen : return 00611 if (bbGlobalGetFreezeExecution()) 00612 { 00613 bbtkBlackBoxDebugMessage("process",2, 00614 " -> FreezeExecution global flag is 'true' : abort execution"<<std::endl); 00615 } 00616 00617 BBTK_BUSY_CURSOR; 00618 00619 // If force is true then update is triggered even if the box is UPTODATE 00620 // if (force) bbSetModifiedStatus(); 00621 00622 // Calls the main recursive execution method 00623 bbRecursiveExecute(Connection::Pointer()); 00624 00625 bbtkBlackBoxDebugMessage("process",2, 00626 "<= BlackBox::bbExecute()" 00627 <<std::endl); 00628 }
void bbtk::BlackBox::bbFinalizeProcessing | ( | ) | [protected, inherited] |
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
Definition at line 645 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbmInitialized, bbtk::BlackBox::bbRecursiveFinalizeProcessing(), and bbtkBlackBoxDebugMessage.
00646 { 00647 if (bbmInitialized) 00648 { 00649 bbtkBlackBoxDebugMessage("process",2,"** Finalize processing" 00650 <<std::endl); 00651 this->bbRecursiveFinalizeProcessing(); 00652 bbmInitialized = false; 00653 } 00654 }
virtual BlackBox::Pointer bbtk::BlackBox::bbFindBlackBox | ( | const std::string & | blackboxname | ) | [inline, protected, virtual, inherited] |
Reimplemented in bbtk::ComplexBlackBox.
Definition at line 417 of file bbtkBlackBox.h.
00418 { return BlackBox::Pointer();}
BlackBox::BoxProcessModeValue bbtk::BlackBox::bbGetBoxProcessModeValue | ( | ) | const [inherited] |
Returns the "decoded" value of the input "BoxProcessMode".
Definition at line 363 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbAlways, bbtk::BlackBox::bbGetFullName(), bbtk::BlackBox::bbmBoxProcessMode, bbtk::BlackBox::bbPipeline, bbtk::BlackBox::bbReactive, and bbtkError.
Referenced by bbtk::BlackBox::bbBoxProcessModeIsAlways(), and bbtk::BlackBox::bbBoxProcessModeIsReactive().
00364 { 00365 const std::string& p = bbmBoxProcessMode; 00366 if ( (p == "0") || 00367 (p == "P") || (p == "p") || 00368 (p == "Pipeline") || (p == "pipeline") ) return bbPipeline; 00369 if ( (p == "1") || 00370 (p == "A") || (p == "a") || 00371 (p == "Always") || (p == "always") ) return bbAlways; 00372 if ( (p == "2") || 00373 (p == "R") || (p == "r") || 00374 (p == "Reactive") || (p == "reactive") ) 00375 return bbReactive; 00376 /* 00377 if ( (p == "3") || 00378 (p == "F") || (p == "f") || 00379 (p == "Flash") || (p == "flash") ) return Flash; 00380 */ 00381 bbtkError(bbGetFullName()<<" : BoxProcessMode value '"<<p 00382 <<"' unknown. Possible values : " 00383 <<"'0'/'P'/'p'/'Pipeline'/'pipeline' | " 00384 <<"'1'/'A'/'a'/'Always'/'always' | " 00385 <<"'2'/'R'/'r'/'Reactive'/'reactive'" 00386 // <<"'3'/'F'/'f'/'Flash'/'flash'" 00387 <<std::endl); 00388 }
bbtk::BlackBoxDescriptor::Pointer bbtk::AtomicBlackBox::bbGetDescriptor | ( | ) | const [inline, virtual] |
Returns the pointer on the descriptor of the box.
Implements bbtk::BlackBox.
Definition at line 57 of file bbtkAtomicBlackBox.h.
Referenced by bbBruteForceSetInputPointer(), bbGetInput(), bbGetOutput(), bbSetInput(), and bbSetOutput().
00058 { 00059 return bbmDescriptorPointer; 00060 }
std::string bbtk::BlackBox::bbGetFullName | ( | ) | const [virtual, inherited] |
Returns the full name of the BlackBox (instance+type).
Definition at line 169 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), and bbtk::BlackBox::bbGetNameWithParent().
Referenced by AtomicBlackBox(), bbtk::BlackBox::bbCopyIOValues(), bbtk::BlackBox::bbGetBoxProcessModeValue(), bbtk::BlackBox::bbSignalOutputModification(), bbtk::BlackBox::BlackBox(), and bbtk::ComplexBlackBox::Check().
00170 { 00171 return this->bbGetNameWithParent()+"<"+this->bbGetDescriptor()->GetTypeName()+">"; 00172 }
void bbtk::BlackBox::bbGetHelp | ( | bool | full = true |
) | const [virtual, inherited] |
Prints the Help on the BlackBox type.
Definition at line 192 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor().
00193 { 00194 bbGetDescriptor()->GetHelp(full); 00195 }
Data bbtk::AtomicBlackBox::bbGetInput | ( | const std::string & | label | ) | [virtual] |
Gets the input Data of a given label.
Gets the input Data of a given name.
Implements bbtk::BlackBox.
Definition at line 97 of file bbtkAtomicBlackBox.cxx.
References bbGetDescriptor(), and bbtkBlackBoxDebugMessage.
00098 { 00099 bbtkBlackBoxDebugMessage("data",7, 00100 "AtomicBlackBox::bbGetInput(\""<<name<<"\")" 00101 <<std::endl); 00102 00103 Data p = ((AtomicBlackBoxInputDescriptor*)bbGetDescriptor() 00104 ->GetInputDescriptor(name))->GetGetFunctor()->Get(this); 00105 00106 return p; 00107 }
std::string bbtk::BlackBox::bbGetInputAsString | ( | const std::string & | input | ) | [inherited] |
Gets the data of the input called <name> as a string using an Adaptor if possible (else returns empty string).
Definition at line 1004 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), bbtk::BlackBox::bbGetInput(), and bbtk::BlackBox::bbGetInputType().
Referenced by bbtk::BlackBox::bbPrintHelp(), bbtk::ComplexBlackBox::bbWriteDotFileBlackBox(), and bbtk::BlackBox::bbWriteDotFileBlackBox().
01005 { 01006 std::string v; 01007 // Looks for the adaptor 01008 if (bbGetInputType(input) != typeid(std::string)) 01009 { 01010 // Look for factory 01011 Package::Pointer p = bbGetDescriptor()->GetPackage(); 01012 if ((p != 0) && ( ! p->GetFactorySet().empty() ) ) 01013 { 01014 Factory::Pointer f = p->GetFactorySet().begin()->lock(); 01015 BlackBox::Pointer a; 01016 try 01017 { 01018 a = f->NewAdaptor( 01019 bbGetInputType(input), 01020 typeid(std::string), 01021 ""); 01022 }catch (bbtk::Exception e) 01023 { 01024 } 01025 if (a) 01026 { 01027 // bbUpdate(); 01028 a->bbSetInput("In",bbGetInput(input)); 01029 a->bbExecute(); 01030 v = a->bbGetOutput("Out").unsafe_get<std::string>() ; 01031 } 01032 else 01033 { 01034 v="? (no adaptor found)"; 01035 } 01036 } 01037 else 01038 { 01039 v="? (no factory found)"; 01040 } 01041 } 01042 else 01043 { 01044 v = bbGetInput(input).unsafe_get<std::string>() ; 01045 } 01046 return v; 01047 }
Void bbtk::BlackBox::bbGetInputBoxExecute | ( | ) | [inline, inherited] |
Returns the value of the input 'BoxExecute'.
Definition at line 313 of file bbtkBlackBox.h.
Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor().
std::string bbtk::BlackBox::bbGetInputBoxProcessMode | ( | ) | [inline, inherited] |
Returns the value of the input 'BoxProcessMode'.
Definition at line 292 of file bbtkBlackBox.h.
Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor().
00292 { return bbmBoxProcessMode; }
const BlackBoxInputConnector& bbtk::BlackBox::bbGetInputConnector | ( | const std::string & | n | ) | const [inline, inherited] |
Returns the input connector (const).
Definition at line 198 of file bbtkBlackBox.h.
00199 { return *(mInputConnectorMap.find(n)->second); }
BlackBoxInputConnector& bbtk::BlackBox::bbGetInputConnector | ( | const std::string & | n | ) | [inline, inherited] |
Returns the input connector.
Definition at line 195 of file bbtkBlackBox.h.
00196 { return *(mInputConnectorMap.find(n)->second); }
const InputConnectorMapType& bbtk::BlackBox::bbGetInputConnectorMap | ( | ) | const [inline, inherited] |
Returns the input connectors map (const).
Definition at line 192 of file bbtkBlackBox.h.
00193 { return mInputConnectorMap; }
InputConnectorMapType& bbtk::BlackBox::bbGetInputConnectorMap | ( | ) | [inline, inherited] |
Returns the input connectors map.
Definition at line 189 of file bbtkBlackBox.h.
Referenced by bbtk::ComplexBlackBox::bbAllocateConnectors(), bbtk::BlackBox::bbAllocateConnectors(), bbBruteForceSetInputPointer(), bbtk::BlackBox::bbComputePostProcessStatus(), bbtk::BlackBox::bbConnectInput(), bbtk::ComplexBlackBox::bbDesallocateConnectors(), bbtk::BlackBox::bbDesallocateConnectors(), bbtk::BlackBox::bbDisconnectInput(), bbSetInput(), bbtk::BlackBox::bbSetStatusAndPropagate(), bbtk::BlackBox::bbUpdateInputs(), and bbtk::ComplexBlackBox::bbWriteDotFileBlackBox().
00190 { return mInputConnectorMap; }
IOStatus bbtk::BlackBox::bbGetInputStatus | ( | const std::string & | name | ) | const [inline, inherited] |
Gets the status of the input called <name>.
Definition at line 157 of file bbtkBlackBox.h.
00158 { return mInputConnectorMap.find(name)->second->GetStatus(); }
TypeInfo bbtk::BlackBox::bbGetInputType | ( | const std::string & | label | ) | const [virtual, inherited] |
Gets the input type of a given label.
Definition at line 242 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), bbtkBlackBoxDebugMessage, and bbtkDebugDecTab.
Referenced by bbtk::BlackBox::bbGetInputAsString().
00243 { 00244 bbtkBlackBoxDebugMessage("kernel",8, 00245 "BlackBox::bbGetInputType(\"" 00246 <<name<<"\")" 00247 <<std::endl); 00248 TypeInfo r = bbGetDescriptor()->GetInputDescriptor(name)->GetTypeInfo(); 00249 bbtkDebugDecTab("kernel",8); 00250 return r; 00251 }
const std::string& bbtk::BlackBox::bbGetName | ( | ) | const [inline, inherited] |
Returns the name of the BlackBox (instance).
Definition at line 131 of file bbtkBlackBox.h.
Referenced by bbtk::ComplexBlackBox::bbGetNameWithParent(), bbtk::ComplexBlackBox::bbInsertHTMLGraph(), bbtk::BlackBox::bbPrintHelp(), bbtk::WidgetBlackBox< W >::bbUserSetDefaultValues(), bbtk::ComplexBlackBox::bbWriteDotFileBlackBox(), bbtk::BlackBox::bbWriteDotFileBlackBox(), and bbtk::ComplexBlackBox::ComplexBlackBox().
00131 { return bbmName; }
std::string bbtk::BlackBox::bbGetNameWithParent | ( | ) | const [virtual, inherited] |
Returns the name with the name of the parent prepended if any.
Reimplemented in bbtk::ComplexBlackBox.
Definition at line 178 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbmName, and bbtk::BlackBox::bbmParent.
Referenced by bbtk::BlackBox::bbGetFullName().
00179 { 00180 if (bbmParent.lock()) 00181 { 00182 return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName; 00183 } 00184 else 00185 { 00186 return bbmName; 00187 } 00188 }
Data bbtk::AtomicBlackBox::bbGetOutput | ( | const std::string & | label | ) | [virtual] |
Gets the output Data of a given label.
Implements bbtk::BlackBox.
Definition at line 81 of file bbtkAtomicBlackBox.cxx.
References bbGetDescriptor(), and bbtkBlackBoxDebugMessage.
00082 { 00083 bbtkBlackBoxDebugMessage("data",7, 00084 "AtomicBlackBox::bbGetOutput(\""<<name<<"\")" 00085 <<std::endl); 00086 00087 Data p = ((AtomicBlackBoxOutputDescriptor*)bbGetDescriptor() 00088 ->GetOutputDescriptor(name))->GetGetFunctor()->Get(this); 00089 00090 return p; 00091 }
std::string bbtk::BlackBox::bbGetOutputAsString | ( | const std::string & | output | ) | [inherited] |
Gets the data of the output called <name> as a string using an Adaptor if possible (else returns empty string).
Definition at line 959 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), bbtk::BlackBox::bbGetOutput(), and bbtk::BlackBox::bbGetOutputType().
Referenced by bbtk::BlackBox::bbPrintHelp(), bbtk::ComplexBlackBox::bbWriteDotFileBlackBox(), and bbtk::BlackBox::bbWriteDotFileBlackBox().
00960 { 00961 std::string v; 00962 // Looks for the adaptor 00963 if (bbGetOutputType(output).name() != typeid(std::string).name() ) 00964 { 00965 // Look for factory 00966 Package::Pointer p = bbGetDescriptor()->GetPackage(); 00967 if ((p != 0) && ( ! p->GetFactorySet().empty() ) ) 00968 { 00969 Factory::Pointer f = p->GetFactorySet().begin()->lock(); 00970 BlackBox::Pointer a; 00971 try 00972 { 00973 a = f->NewAdaptor( 00974 bbGetOutputType(output), 00975 typeid(std::string), 00976 ""); 00977 } catch (bbtk::Exception e) 00978 { 00979 } 00980 if (a){ 00981 // bbUpdate(); 00982 a->bbSetInput("In",bbGetOutput(output)); 00983 a->bbExecute(); 00984 v = a->bbGetOutput("Out").unsafe_get<std::string>() ; 00985 } else { 00986 v="? (no adaptor found)"; 00987 } 00988 } 00989 else 00990 { 00991 v="? (no factory found)"; 00992 } 00993 } 00994 else 00995 { 00996 // bbUpdate(); 00997 v = bbGetOutput(output).unsafe_get<std::string>() ; 00998 } 00999 return v; 01000 }
Void bbtk::BlackBox::bbGetOutputBoxChange | ( | ) | [inline, inherited] |
Returns the value of the output 'BoxChange'.
Definition at line 318 of file bbtkBlackBox.h.
Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor().
const BlackBoxOutputConnector& bbtk::BlackBox::bbGetOutputConnector | ( | const std::string & | n | ) | const [inline, inherited] |
Returns the output connector (const).
Definition at line 212 of file bbtkBlackBox.h.
00213 { return *(mOutputConnectorMap.find(n)->second); }
BlackBoxOutputConnector& bbtk::BlackBox::bbGetOutputConnector | ( | const std::string & | n | ) | [inline, inherited] |
Returns the output connector.
Definition at line 209 of file bbtkBlackBox.h.
Referenced by bbtk::BlackBox::bbAddOutputObserver().
00210 { return *(mOutputConnectorMap.find(n)->second); }
const OutputConnectorMapType& bbtk::BlackBox::bbGetOutputConnectorMap | ( | ) | const [inline, inherited] |
Returns the output connectors map (const).
Definition at line 206 of file bbtkBlackBox.h.
00207 { return mOutputConnectorMap; }
OutputConnectorMapType& bbtk::BlackBox::bbGetOutputConnectorMap | ( | ) | [inline, inherited] |
Returns the output connectors map.
Definition at line 203 of file bbtkBlackBox.h.
Referenced by bbtk::ComplexBlackBox::bbAllocateConnectors(), bbtk::BlackBox::bbAllocateConnectors(), bbtk::BlackBox::bbComputePostProcessStatus(), bbtk::BlackBox::bbConnectOutput(), bbtk::ComplexBlackBox::bbDesallocateConnectors(), bbtk::BlackBox::bbDesallocateConnectors(), bbtk::BlackBox::bbDisconnectOutput(), bbtk::WidgetBlackBox< W >::bbIsOutputWidgetConnected(), bbtk::BlackBox::bbRecursiveExecute(), bbtk::BlackBox::bbSetStatusAndPropagate(), and bbtk::BlackBox::bbSignalOutputModification().
00204 { return mOutputConnectorMap; }
TypeInfo bbtk::BlackBox::bbGetOutputType | ( | const std::string & | label | ) | const [virtual, inherited] |
Gets the output type of a given label.
Definition at line 229 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), bbtkBlackBoxDebugMessage, and bbtkDebugDecTab.
Referenced by bbtk::BlackBox::bbGetOutputAsString().
00230 { 00231 bbtkBlackBoxDebugMessage("kernel",8, 00232 "BlackBox::bbGetOutputType(\"" 00233 <<name<<"\")" 00234 <<std::endl); 00235 TypeInfo r = bbGetDescriptor()->GetOutputDescriptor(name)->GetTypeInfo(); 00236 bbtkDebugDecTab("kernel",8); 00237 return r; 00238 }
BlackBox::Pointer bbtk::BlackBox::bbGetParent | ( | ) | const [inline, inherited] |
Returns the parent of the BlackBox, i.e the BlackBox that contains it (0 if none).
Definition at line 140 of file bbtkBlackBox.h.
00140 { return bbmParent.lock(); }
const std::string& bbtk::BlackBox::bbGetTypeName | ( | ) | const [inline, inherited] |
Returns the Name of the Type of the BlackBox.
Definition at line 126 of file bbtkBlackBox.h.
Referenced by bbtk::WidgetBlackBox< wxWindow >::bbCreateDialogWindow(), bbtk::WidgetBlackBox< wxWindow >::bbCreateFrameWindow(), bbtk::ComplexBlackBox::bbInsertHTMLGraph(), bbtk::WidgetBlackBox< wxWindow >::bbUserCreateWidget(), bbtk::ComplexBlackBox::bbWriteDotFileBlackBox(), bbtk::BlackBox::bbWriteDotFileBlackBox(), bbtk::ComplexBlackBox::bbWriteDotInputOutputName(), and bbtk::BlackBox::bbWriteDotInputOutputName().
00127 { return bbGetDescriptor()->GetTypeName(); }
void bbtk::BlackBox::bbGlobalAddToExecutionList | ( | BlackBox::Pointer | b | ) | [static, inherited] |
Definition at line 1429 of file bbtkBlackBox.cxx.
References bbtk::bbmgExecutionList, bbtk::bbmgGlobalProcessingExecutionList, and bbtkDebugMessage.
Referenced by bbtk::BlackBox::bbSetStatusAndPropagate().
01430 { 01431 bbtkDebugMessage("process",3,"* bbGlobalAddToExecutionList("<<b->bbGetName()<<")"<<std::endl); 01432 if (bbmgGlobalProcessingExecutionList) 01433 { 01434 bbtkDebugMessage("process",3,"bbGlobalAddToExecutionList called inside bbGlobalProcessExecutionList !"); 01435 } 01436 bbmgExecutionList.insert(b); 01437 }
bool bbtk::BlackBox::bbGlobalGetFreezeExecution | ( | ) | [static, inherited] |
Definition at line 1424 of file bbtkBlackBox.cxx.
References bbtk::bbmgFreezeExecution.
Referenced by bbtk::BlackBox::bbExecute().
01425 { 01426 return bbmgFreezeExecution; 01427 }
bool bbtk::BlackBox::bbGlobalGetSomeBoxExecuting | ( | ) | [static, inherited] |
Definition at line 1409 of file bbtkBlackBox.cxx.
References bbtk::bbmgSomeBoxExecuting.
Referenced by bbtk::BlackBox::bbCanReact(), and bbtk::BlackBox::bbRecursiveExecute().
01410 { 01411 return bbmgSomeBoxExecuting; 01412 }
void bbtk::BlackBox::bbGlobalProcessExecutionList | ( | ) | [static, inherited] |
Definition at line 1368 of file bbtkBlackBox.cxx.
References bbtk::bbmgExecutionList, bbtk::bbmgGlobalProcessingExecutionList, bbtkDebugMessage, bbtkGlobalError, and bbtk::i.
Referenced by bbtk::BlackBox::bbSignalOutputModification().
01369 { 01370 bbtkDebugMessage("process",3, 01371 "=> BlackBox::bbGlobalProcessExecutionList()" 01372 <<std::endl); 01373 if (bbmgGlobalProcessingExecutionList) 01374 { 01375 bbtkDebugMessage("process",3,"BlackBox::bbGlobalProcessExecutionList() reentered !"); 01376 return; 01377 } 01378 bbmgGlobalProcessingExecutionList = true; 01379 01380 std::set<BlackBox::WeakPointer>::iterator i; 01381 while (bbmgExecutionList.size()>0) 01382 { 01383 i = bbmgExecutionList.begin(); 01384 BlackBox::WeakPointer p = *i; 01385 bbmgExecutionList.erase(i); 01386 if (p.lock()) 01387 { 01388 bbtkDebugMessage("process",4, 01389 " -> Executing '"<< 01390 p.lock()->bbGetName()<<"'"<<std::endl); 01391 p.lock()->bbExecute(true); 01392 } 01393 else 01394 { 01395 bbtkGlobalError("Strange error in BlackBox::bbGlobalProcessExecutionList() : Weak bb pointer in bbmgExecutionList is no more valid..."); 01396 } 01397 } 01398 01399 bbmgExecutionList.clear(); 01400 bbtkDebugMessage("process",3, 01401 "<= BlackBox::bbGlobalProcessExecutionList()" 01402 <<std::endl); 01403 01404 bbmgGlobalProcessingExecutionList = false; 01405 01406 }
void bbtk::BlackBox::bbGlobalSetFreezeExecution | ( | bool | b | ) | [static, inherited] |
Definition at line 1419 of file bbtkBlackBox.cxx.
References bbtk::bbmgFreezeExecution.
01420 { 01421 bbmgFreezeExecution = b; 01422 }
void bbtk::BlackBox::bbGlobalSetSomeBoxExecuting | ( | bool | b | ) | [static, inherited] |
Definition at line 1414 of file bbtkBlackBox.cxx.
References bbtk::bbmgSomeBoxExecuting.
Referenced by bbtk::BlackBox::bbRecursiveExecute().
01415 { 01416 bbmgSomeBoxExecuting = b; 01417 }
bool bbtk::BlackBox::bbHasInput | ( | const std::string & | label | ) | const [virtual, inherited] |
Returns true iff the BlackBox has an input of name label.
Definition at line 200 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), bbtkBlackBoxDebugMessage, and bbtkDebugDecTab.
00201 { 00202 bbtkBlackBoxDebugMessage("kernel",8, 00203 "BlackBox::bbHasInput(\"" 00204 <<name<<"\")" 00205 <<std::endl); 00206 bool r = ( bbGetDescriptor()->GetInputDescriptorMap().find(name) 00207 != bbGetDescriptor()->GetInputDescriptorMap().end()); 00208 bbtkDebugDecTab("kernel",8); 00209 return r; 00210 }
bool bbtk::BlackBox::bbHasOutput | ( | const std::string & | label | ) | const [virtual, inherited] |
Returns true iff the BlackBox has an output of name label.
Definition at line 215 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), bbtkBlackBoxDebugMessage, and bbtkDebugDecTab.
00216 { 00217 bbtkBlackBoxDebugMessage("kernel",8,"BlackBox::bbHasOutput(\"" 00218 <<name<<"\")" 00219 <<std::endl); 00220 bool r = ( bbGetDescriptor()->GetOutputDescriptorMap().find(name) 00221 != bbGetDescriptor()->GetOutputDescriptorMap().end()); 00222 bbtkDebugDecTab("kernel",8); 00223 return r; 00224 }
void bbtk::BlackBox::bbInitializeProcessing | ( | ) | [protected, inherited] |
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
Definition at line 632 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbmInitialized, bbtk::BlackBox::bbRecursiveInitializeProcessing(), and bbtkBlackBoxDebugMessage.
Referenced by bbtk::BlackBox::bbRecursiveExecute().
00633 { 00634 if (!bbmInitialized) 00635 { 00636 bbtkBlackBoxDebugMessage("process",2,"** Initialize processing" 00637 <<std::endl); 00638 this->bbRecursiveInitializeProcessing(); 00639 bbmInitialized = true; 00640 } 00641 }
void bbtk::BlackBox::bbInsertHTMLGraph | ( | std::ofstream & | s, | |
int | detail, | |||
int | level, | |||
bool | instanceOrtype, | |||
const std::string & | output_dir, | |||
bool | relative_link | |||
) | [inline, inherited] |
Does nothing here : overloaded in ComplexBlackBox.
Reimplemented in bbtk::ComplexBlackBox.
Definition at line 329 of file bbtkBlackBox.h.
virtual bool bbtk::BlackBox::bbIsShown | ( | ) | [inline, virtual, inherited] |
Reimplemented in bbtk::WidgetBlackBox< W >, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 342 of file bbtkBlackBox.h.
virtual void bbtk::AtomicBlackBox::bbLockDescriptor | ( | ) | [protected, pure virtual] |
void bbtk::BlackBox::bbPrintHelp | ( | BlackBox::Pointer | parentblackbox, | |
int | detail, | |||
int | level | |||
) | [virtual, inherited] |
Definition at line 1207 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), bbtk::BlackBox::bbGetInputAsString(), bbtk::BlackBox::bbGetName(), bbtk::BlackBox::bbGetOutputAsString(), bbtkBlackBoxMessage, bbtk::GetIOStatusString(), bbtk::Connection::GetOriginalBlackBoxFrom(), bbtk::Connection::GetOriginalBlackBoxFromOutput(), bbtk::i, bbtk::BlackBox::mInputConnectorMap, and bbtk::BlackBox::mOutputConnectorMap.
01210 { 01211 01212 if (this->bbGetDescriptor()->GetPackage()) 01213 { 01214 bbtkBlackBoxMessage("help",1,"Black Box '"<<bbGetName()<<"' <"<< 01215 this->bbGetDescriptor()->GetPackage()->GetName() 01216 <<"::"<<this->bbGetDescriptor()->GetTypeName()<<">"<<std::endl); 01217 } 01218 else 01219 { 01220 bbtkBlackBoxMessage("help",1,"Black Box <::"<<this->bbGetDescriptor()->GetTypeName()<<">"<<std::endl); 01221 } 01222 /* 01223 if (bbIsUpToDate()) 01224 { 01225 bbtkBlackBoxMessage("help",1,"Up-to-date ["<<mMaxInputChangeTime<<"," 01226 <<mMinOutputChangeTime<<"]"<<std::endl); 01227 } 01228 else 01229 { 01230 bbtkBlackBoxMessage("help",1,"Out-of-date ["<<mMaxInputChangeTime<<"," 01231 <<mMinOutputChangeTime<<"]"<<std::endl); 01232 } 01233 */ 01234 // bbtkBlackBoxMessage("help",1," "<<GetDescription()<<std::endl); 01235 // bbtkBlackBoxMessage("help",1," By : "<<GetAuthor()<<std::endl); 01236 01237 std::vector<std::string> iname; 01238 std::vector<std::string> ivalue; 01239 std::vector<std::string> iconn; 01240 std::vector<std::string> istatus; 01241 01242 InputConnectorMapType::iterator i; 01243 unsigned int namelmax = 0; 01244 unsigned int valuelmax = 0; 01245 // unsigned int connlmax = 0; 01246 for ( i = mInputConnectorMap.begin(); i != mInputConnectorMap.end(); ++i ) 01247 { 01248 iname.push_back(i->first); 01249 if (iname.back().size()>namelmax) namelmax = iname.back().size(); 01250 ivalue.push_back(bbGetInputAsString(i->first)); 01251 if (ivalue.back().size()>valuelmax) valuelmax = ivalue.back().size(); 01252 std::string s(""); 01253 Connection* con = i->second->GetConnection(); 01254 if (con!=0){ 01255 s = con->GetOriginalBlackBoxFrom()->bbGetName(); 01256 s += "."; 01257 s += con->GetOriginalBlackBoxFromOutput(); 01258 } // if con 01259 iconn.push_back(s); 01260 istatus.push_back(GetIOStatusString(i->second->GetStatus())); 01261 } 01262 OutputConnectorMapType::iterator o; 01263 std::vector<std::string> oname; 01264 std::vector<std::string> ovalue; 01265 std::vector<std::vector<std::string> > oconn; 01266 std::vector<std::string> ostatus; 01267 for ( o = mOutputConnectorMap.begin(); o != mOutputConnectorMap.end(); ++o ) 01268 { 01269 oname.push_back(o->first); 01270 if (oname.back().size()>namelmax) 01271 namelmax = oname.back().size(); 01272 ovalue.push_back(bbGetOutputAsString(o->first)); 01273 if (ovalue.back().size()>valuelmax) 01274 valuelmax = ovalue.back().size(); 01275 std::vector<std::string> ss; 01276 const std::vector<Connection*>& con 01277 = o->second->GetConnectionVector(); 01278 std::vector<Connection*>::const_iterator c; 01279 for (c=con.begin();c!=con.end();++c) 01280 { 01281 std::string s; 01282 s = (*c)->GetOriginalBlackBoxTo()->bbGetName(); 01283 s += "."; 01284 s += (*c)->GetOriginalBlackBoxToInput(); 01285 ss.push_back(s); 01286 } // if con 01287 oconn.push_back(ss); 01288 ostatus.push_back(GetIOStatusString(o->second->GetStatus())); 01289 } 01290 01291 if (iname.size()) 01292 bbtkBlackBoxMessage("help",1," * Inputs : "<<std::endl); 01293 else 01294 bbtkBlackBoxMessage("help",1," * No inputs"<<std::endl); 01295 01296 std::vector<std::string>::iterator i1,i2,i3,i4; 01297 for (i1=iname.begin(),i2=ivalue.begin(),i3=iconn.begin(),i4=istatus.begin(); 01298 i1!=iname.end(),i2!=ivalue.end(),i3!=iconn.end(),i4!=istatus.end(); 01299 ++i1,++i2,++i3,++i4) 01300 { 01301 std::string name(*i1); 01302 name += "'"; 01303 name.append(1+namelmax-name.size(),' '); 01304 std::string value(*i2); 01305 value += "'"; 01306 value.append(1+valuelmax-value.size(),' '); 01307 if (i3->size()) 01308 bbtkBlackBoxMessage("help",1," '"<<name<<" = '"<<value<<" <-- '" <<*i3<<"'"); 01309 else 01310 bbtkBlackBoxMessage("help",1," '"<<name<<" = '"<<value); 01311 bbtkBlackBoxMessage("help",1," ["<<*i4<<"]"<<std::endl); 01312 } 01313 01314 if (oname.size()) 01315 bbtkBlackBoxMessage("help",1," * Outputs : "<<std::endl); 01316 else 01317 bbtkBlackBoxMessage("help",1," * No outputs"<<std::endl); 01318 01319 std::vector<std::vector<std::string> >::iterator i5; 01320 01321 for (i1=oname.begin(),i2=ovalue.begin(),i5=oconn.begin(),i4=ostatus.begin(); 01322 i1!=oname.end(),i2!=ovalue.end(),i5!=oconn.end(),i4!=ostatus.end(); 01323 ++i1,++i2,++i4,++i5) 01324 { 01325 std::string name(*i1); 01326 name += "'"; 01327 name.append(1+namelmax-name.size(),' '); 01328 std::string value(*i2); 01329 value += "'"; 01330 value.append(1+valuelmax-value.size(),' '); 01331 if (!(*i5).size()) 01332 bbtkBlackBoxMessage("help",1," '"<<name<<" = '"<<value); 01333 else 01334 { 01335 std::string pref = " '"+name+" = '"+value; 01336 for (i3=i5->begin();i3!=i5->end();++i3) 01337 { 01338 bbtkBlackBoxMessage("help",1,pref<<" --> '"<<*i3<<"'"); 01339 pref.replace(0,pref.size(),pref.size(),' '); 01340 } 01341 } 01342 bbtkBlackBoxMessage("help",1," ["<<*i4<<"]"<<std::endl); 01343 } 01344 01345 }
virtual void bbtk::AtomicBlackBox::bbProcess | ( | ) | [inline, protected, virtual] |
Calls the user defined processing method. Overloaded in WxBlackBox to handle widget creation and show
Reimplemented from bbtk::BlackBox.
Reimplemented in bbtk::WidgetBlackBox< W >, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 102 of file bbtkAtomicBlackBox.h.
00102 { this->bbUserProcess(); }
void bbtk::BlackBox::bbRecursiveExecute | ( | Connection::Pointer | caller | ) | [protected, virtual, inherited] |
Recursive execution method
caller | : The connection which invoked the method; null if called by bbExecute |
Definition at line 659 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbBoxProcessModeIsAlways(), bbtk::BlackBox::bbComputePostProcessStatus(), bbtk::BlackBox::bbCreateWindow(), bbtk::BlackBox::bbGetExecuting(), bbtk::BlackBox::bbGetOutputConnectorMap(), bbtk::BlackBox::bbGlobalGetSomeBoxExecuting(), bbtk::BlackBox::bbGlobalSetSomeBoxExecuting(), bbtk::BlackBox::bbInitializeProcessing(), bbtk::BlackBox::bbProcess(), bbtk::BlackBox::bbSetExecuting(), bbtk::BlackBox::bbShowWindow(), bbtkBlackBoxDebugMessage, bbtkWarning, bbtk::BlackBox::bbUpdateInputs(), and bbtk::UPTODATE.
Referenced by bbtk::BlackBox::bbExecute().
00660 { 00661 bbtkBlackBoxDebugMessage("process",3, 00662 "=> BlackBox::bbRecursiveExecute(" 00663 <<(caller?caller->GetFullName():"0")<<")" 00664 <<std::endl); 00665 00666 // If already executing : return 00667 if (bbGetExecuting()) 00668 { 00669 bbtkBlackBoxDebugMessage("process",3, 00670 " -> already executing : abort"<<std::endl); 00671 return; 00672 } 00673 00674 // If not initialized do it 00675 bbInitializeProcessing(); 00676 00677 bbSetExecuting(true); 00678 bool wasExecuting = bbGlobalGetSomeBoxExecuting(); 00679 bbGlobalSetSomeBoxExecuting(true); 00680 00681 // Creates the window if the black box has one 00682 this->bbCreateWindow(); 00683 00684 // Updates its inputs 00685 IOStatus s = bbUpdateInputs(); 00686 00687 if ( (s != UPTODATE) || 00688 bbBoxProcessModeIsAlways() ) 00689 { 00690 // Displays the window (WxBlackbox) 00691 // bbShowWindow(caller); 00692 00693 // Actual processing (virtual) 00694 this->bbProcess(); 00695 00696 00697 // Update the I/O statuses 00698 bbComputePostProcessStatus(); 00699 } 00700 else 00701 { 00702 // Test output status... 00703 OutputConnectorMapType::iterator o; 00704 for ( o = bbGetOutputConnectorMap().begin(); 00705 o!= bbGetOutputConnectorMap().end(); ++o) 00706 { 00707 if (o->second->GetStatus() != UPTODATE) 00708 { 00709 bbtkWarning("BlackBox::bbRecursiveExecute: " 00710 <<"all inputs are Up-to-date but output '" 00711 <<o->first<<"' is Out-of-date ???"); 00712 } 00713 } 00714 00715 bbtkBlackBoxDebugMessage("process",3," -> Up-to-date : nothing to do" 00716 <<std::endl); 00717 } 00718 00719 // Shows the window if the black box has one 00720 this->bbShowWindow(); 00721 00722 00723 bbtkBlackBoxDebugMessage("process",3, 00724 "<= BlackBox::bbRecursiveExecute()" 00725 <<std::endl); 00726 00727 bbSetExecuting(false); 00728 bbGlobalSetSomeBoxExecuting(wasExecuting); 00729 00730 return; 00731 }
virtual void bbtk::BlackBox::bbRecursiveFinalizeProcessing | ( | ) | [inline, protected, virtual, inherited] |
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)
Reimplemented in bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 541 of file bbtkBlackBox.h.
Referenced by bbtk::BlackBox::bbFinalizeProcessing().
virtual void bbtk::BlackBox::bbRecursiveInitializeProcessing | ( | ) | [inline, protected, virtual, inherited] |
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)
Reimplemented in bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 532 of file bbtkBlackBox.h.
Referenced by bbtk::BlackBox::bbInitializeProcessing().
void bbtk::BlackBox::bbRemoveOutputObserver | ( | const std::string & | output_name, | |
OutputChangeCallbackType | f | |||
) | [inherited] |
Removes the function f from the list of functions to call when the output changes (TO WRITE)
Definition at line 417 of file bbtkBlackBox.cxx.
References bbtkError.
00419 { 00420 bbtkError("BlackBox::RemoveChangeObserver NOT IMPLEMENTED"); 00421 }
void bbtk::AtomicBlackBox::bbSetInput | ( | const std::string & | name, | |
Data | data, | |||
bool | setModified = true | |||
) | [virtual] |
Sets the data of the input called <name>.
Implements bbtk::BlackBox.
Definition at line 129 of file bbtkAtomicBlackBox.cxx.
References bbGetDescriptor(), bbtk::BlackBox::bbGetInputConnectorMap(), bbtk::BlackBox::bbSetStatusAndPropagate(), bbtkBlackBoxDebugMessage, and bbtk::MODIFIED.
00132 { 00133 bbtkBlackBoxDebugMessage("data",7, 00134 "AtomicBlackBox::bbSetInput(\""<<name<<"\",data)" 00135 <<std::endl); 00136 ((AtomicBlackBoxInputDescriptor*)bbGetDescriptor()->GetInputDescriptor(name))->GetSetFunctor()->Set(this,data); 00137 00138 if (setModified) 00139 { 00140 bbSetStatusAndPropagate(bbGetInputConnectorMap().find(name)->second, 00141 MODIFIED); 00142 } 00143 00144 }
void bbtk::BlackBox::bbSetInputBoxExecute | ( | Void | = 0 |
) | [inline, inherited] |
Sets the value of the input 'BoxExecute'.
Definition at line 315 of file bbtkBlackBox.h.
Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor().
void bbtk::BlackBox::bbSetInputBoxProcessMode | ( | std::string | a | ) | [inline, inherited] |
Sets the value of the input 'BoxProcessMode'.
Definition at line 294 of file bbtkBlackBox.h.
Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor().
00294 { bbmBoxProcessMode = a; }
void bbtk::AtomicBlackBox::bbSetOutput | ( | const std::string & | name, | |
Data | data | |||
) | [virtual] |
Sets the data of the output called <name>.
Implements bbtk::BlackBox.
Definition at line 113 of file bbtkAtomicBlackBox.cxx.
References bbGetDescriptor(), bbtkBlackBoxDebugMessage, and bbtkDebugDecTab.
00114 { 00115 bbtkBlackBoxDebugMessage("data",7, 00116 "AtomicBlackBox::bbSetOutput(\""<<name<<"\",data)" 00117 <<std::endl); 00118 00119 ((AtomicBlackBoxOutputDescriptor*)bbGetDescriptor() 00120 ->GetOutputDescriptor(name))->GetSetFunctor()->Set(this,data); 00121 00122 bbtkDebugDecTab("Data",7); 00123 }
void bbtk::BlackBox::bbSetOutputBoxChange | ( | Void | = 0 |
) | [inline, inherited] |
Sets the value of the output 'BoxChange'.
Definition at line 320 of file bbtkBlackBox.h.
Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor().
virtual void bbtk::BlackBox::bbSetShown | ( | bool | ) | [inline, virtual, inherited] |
Reimplemented in bbtk::WidgetBlackBox< W >, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 341 of file bbtkBlackBox.h.
void bbtk::BlackBox::bbSetStatusAndPropagate | ( | BlackBoxInputConnector * | c, | |
IOStatus | s | |||
) | [protected, virtual, inherited] |
Signals that the input whose connector is c has changed and propagates the info downward NOT USER INTENDED **
Definition at line 426 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbBoxProcessModeIsReactive(), bbtk::BlackBox::bbCanReact(), bbtk::BlackBox::bbGetInputConnectorMap(), bbtk::BlackBox::bbGetOutputConnectorMap(), bbtk::BlackBox::bbGlobalAddToExecutionList(), bbtkBlackBoxDebugMessage, bbtkError, bbtk::GetIOStatusString(), bbtk::OUTOFDATE, bbtk::BlackBoxInputConnector::SetStatus(), and bbtk::UPTODATE.
Referenced by bbBruteForceSetInputPointer(), bbtk::BlackBox::bbConnectInput(), and bbSetInput().
00428 { 00429 bbtkBlackBoxDebugMessage("change",5, 00430 "=> BlackBox::bbSetStatusAndPropagate(input," 00431 <<GetIOStatusString(s)<<")" 00432 <<std::endl); 00433 00434 if (s==UPTODATE) bbtkError("bbSetStatusAndPropagate with status UPTODATE!"); 00435 c->SetStatus(s); 00436 00437 // Flash reaction 00438 /* 00439 if (bbGetBoxProcessModeValue() == Flash) 00440 { 00441 this->bbExecute(); 00442 } 00443 */ 00444 00445 OutputConnectorMapType::const_iterator o; 00446 for ( o = bbGetOutputConnectorMap().begin(); 00447 o != bbGetOutputConnectorMap().end(); ++o ) 00448 { 00449 if (o->second->GetStatus()==UPTODATE) 00450 { 00451 o->second->SetStatus(OUTOFDATE); 00452 o->second->SignalChange(GetThisPointer<BlackBox>(),o->first); 00453 } 00454 } 00455 00456 if ( ( bbBoxProcessModeIsReactive() 00457 || (c==bbGetInputConnectorMap().find("BoxExecute")->second)) 00458 && (bbCanReact() ) ) 00459 { 00460 bbtkBlackBoxDebugMessage("change",2, 00461 "-> Execution triggered by Reactive mode or BoxExecute input change"<<std::endl); 00462 bbGlobalAddToExecutionList( GetThisPointer<BlackBox>() ); 00463 } 00464 bbtkBlackBoxDebugMessage("change",5, 00465 "<= BlackBox::bbSetStatusAndPropagate(input)" 00466 <<std::endl); 00467 }
virtual void bbtk::BlackBox::bbShowWindow | ( | ) | [inline, protected, virtual, inherited] |
Actual ShowWindow method (vitual) Overloaded in AtomicBlacBox and descendants
Reimplemented in bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 464 of file bbtkBlackBox.h.
Referenced by bbtk::BlackBox::bbRecursiveExecute().
void bbtk::BlackBox::bbSignalOutputModification | ( | const std::vector< std::string > & | output_name, | |
bool | reaction = true | |||
) | [virtual, inherited] |
Signals that the BlackBox vector of outputs "output_name" have been modified. Should be used when more than ONE output is modified but not ALL (optimization issue). (without marking the box as MODIFIED because its output state is ok). This method should be used by widgets in response to user interaction When more than one output has been changed but not all (after the outputs have been updated of course!) DO NOT PASS reaction = false OR WILL NOT WORK PROPERLY USER INTENDED **
Definition at line 543 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetFullName(), bbtk::BlackBox::bbGetOutputConnectorMap(), bbtk::BlackBox::bbGlobalProcessExecutionList(), bbtkBlackBoxDebugMessage, bbtkError, and bbtk::i.
00545 { 00546 bbtkBlackBoxDebugMessage("change",5, 00547 "=> BlackBox::bbSignalOutputModification(vector of outputs)" 00548 <<std::endl); 00549 OutputConnectorMapType::iterator i; 00550 std::vector<std::string>::const_iterator o; 00551 bool changed = false; 00552 for (o=output.begin();o!=output.end();++o) 00553 { 00554 // the output "BoxChange" must be signaled **AFTER** all others 00555 if (*o == "BoxChange") continue; 00556 // Look for the connector 00557 i = bbGetOutputConnectorMap().find(*o); 00558 if ( i == bbGetOutputConnectorMap().end() ) 00559 { 00560 bbtkError("BlackBox["<<bbGetFullName()<<"]::bbSignalOutputModification("<<*o<<") : unknown output"); 00561 } 00562 00563 // if (i->second->GetStatus()==UPTODATE) 00564 // { 00565 i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 00566 changed = true; 00567 // } 00568 } 00569 // Has to notify the output "BoxChange" also 00570 i = bbGetOutputConnectorMap().find("BoxChange"); 00571 if ( changed && (i != bbGetOutputConnectorMap().end())) 00572 { 00573 // if (i->second->GetStatus()==UPTODATE) 00574 // { 00575 i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 00576 if (reaction) bbGlobalProcessExecutionList(); 00577 // } 00578 } 00579 00580 bbtkBlackBoxDebugMessage("change",5, 00581 "<= BlackBox::bbSignalOutputModification(vector of outputs)" 00582 <<std::endl); 00583 }
void bbtk::BlackBox::bbSignalOutputModification | ( | const std::string & | output_name, | |
bool | reaction = true | |||
) | [virtual, inherited] |
Signals that the BlackBox output "output_name" has been modified (without marking the box as MODIFIED because its output state is ok : don't care if you understand : use it !). This method should be used by widgets in response to user interaction only when **ONE** output has been modified (after the output has been updated !) DO NOT PASS reaction = false OR WILL NOT WORK PROPERLY USER INTENDED **
Definition at line 504 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetFullName(), bbtk::BlackBox::bbGetOutputConnectorMap(), bbtk::BlackBox::bbGlobalProcessExecutionList(), bbtkBlackBoxDebugMessage, bbtkError, and bbtk::i.
00506 { 00507 bbtkBlackBoxDebugMessage("change",5, 00508 "=> BlackBox::bbSignalOutputModification(" 00509 <<output<<","<<reaction<<")" 00510 <<std::endl); 00511 00512 OutputConnectorMapType::iterator i = 00513 bbGetOutputConnectorMap().find(output); 00514 00515 00516 if ( i == bbGetOutputConnectorMap().end() ) 00517 { 00518 bbtkError("BlackBox["<<bbGetFullName()<<"]::bbSignalOutputModification("<<output<<") : unknown output"); 00519 } 00520 00521 // if (i->second->GetStatus()==UPTODATE) 00522 // { 00523 i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 00524 // Has to notify the output "BoxChange" also 00525 if (output != "BoxChange") 00526 { 00527 i = bbGetOutputConnectorMap().find("BoxChange"); 00528 if ( i != bbGetOutputConnectorMap().end() ) 00529 { 00530 i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 00531 } 00532 } 00533 if (reaction) bbGlobalProcessExecutionList(); 00534 // } 00535 00536 bbtkBlackBoxDebugMessage("change",5, 00537 "<= BlackBox::bbSignalOutputModification(" 00538 <<output<<")" 00539 <<std::endl); 00540 }
void bbtk::BlackBox::bbSignalOutputModification | ( | bool | reaction = true |
) | [virtual, inherited] |
Signals that the BlackBox outputs have been modified (without marking the box as MODIFIED because its output state is ok : don't care if you understand : use it !). This method should be used by widgets in response to user interaction when **ALL** outputs have been modified (after the outputs has been updated !). DO NOT PASS reaction = false OR WILL NOT WORK PROPERLY USER INTENDED **
Definition at line 472 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetOutputConnectorMap(), bbtk::BlackBox::bbGlobalProcessExecutionList(), bbtkBlackBoxDebugMessage, and bbtk::i.
00473 { 00474 bbtkBlackBoxDebugMessage("change",5, 00475 "=> BlackBox::bbSignalOutputModification(" 00476 <<reaction<<")" 00477 <<"]"<<std::endl); 00478 00479 OutputConnectorMapType::iterator i; 00480 for ( i = bbGetOutputConnectorMap().begin(); 00481 i != bbGetOutputConnectorMap().end(); ++i) 00482 { 00483 // std::cout << "Stat = " 00484 //<<GetIOStatusString(i->second->GetStatus()) 00485 // <<std::endl; 00486 // LG : CANNOT SIGNAL ONLY WHEN UPTODATE 00487 // See bbtkSampleOutputObserver 00488 // if (i->second->GetStatus()==UPTODATE) 00489 // { 00490 i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 00491 // } 00492 } // for 00493 00494 if (reaction) bbGlobalProcessExecutionList(); 00495 00496 bbtkBlackBoxDebugMessage("change",5, 00497 "<= BlackBox::bbSignalOutputModification()" 00498 <<std::endl); 00499 }
IOStatus bbtk::BlackBox::bbUpdateInputs | ( | ) | [protected, inherited] |
Updates the BlackBox inputs Calls RecursiveExecute on all BlackBoxInputConnector
Definition at line 739 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetInputConnectorMap(), bbtkBlackBoxDebugMessage, bbtk::GetIOStatusString(), bbtk::i, and bbtk::UPTODATE.
Referenced by bbtk::BlackBox::bbRecursiveExecute().
00740 { 00741 bbtkBlackBoxDebugMessage("process",4, 00742 "=> BlackBox::bbUpdateInputs()" 00743 <<std::endl); 00744 00745 IOStatus s = UPTODATE; 00746 00747 InputConnectorMapType::iterator i; 00748 for ( i = bbGetInputConnectorMap().begin(); 00749 i!= bbGetInputConnectorMap().end(); ++i) 00750 { 00751 // if (i->first=="WinHide") continue; 00752 // If input type is Void : no recurse 00753 //if ( bbGetDescriptor()->GetInputDescriptor(i->first)->GetTypeInfo() 00754 // == typeid(Void) ) 00755 // continue; 00756 bbtkBlackBoxDebugMessage("change",2, 00757 "Input '"<<i->first 00758 <<"': status before update = '" 00759 <<GetIOStatusString(i->second->GetStatus()) 00760 <<"'"<<std::endl); 00761 i->second->RecursiveExecute(); 00762 IOStatus t = i->second->GetStatus(); 00763 if (t > s) s = t; 00764 bbtkBlackBoxDebugMessage("change",2, 00765 "Input '"<<i->first 00766 <<"': status before process = '" 00767 <<GetIOStatusString(i->second->GetStatus()) 00768 <<"'"<<std::endl); 00769 } 00770 00771 bbtkBlackBoxDebugMessage("process",4, 00772 "<= BlackBox::bbUpdateInputs()" 00773 <<std::endl); 00774 return s; 00775 }
virtual int bbtk::AtomicBlackBox::bbUserConstructor | ( | ) | [inline, protected, virtual] |
*** 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
Definition at line 123 of file bbtkAtomicBlackBox.h.
virtual int bbtk::AtomicBlackBox::bbUserCopyConstructor | ( | bbtk::BlackBox::Pointer | ) | [inline, protected, virtual] |
*** TO BE REMOVED WHEN EVERYTHING IS OK *** THE SAME AS bbUserConstructor
Definition at line 126 of file bbtkAtomicBlackBox.h.
virtual int bbtk::AtomicBlackBox::bbUserDestructor | ( | ) | [inline, protected, virtual] |
*** TO BE REMOVED WHEN EVERYTHING IS OK *** THE SAME AS bbUserConstructor
Definition at line 129 of file bbtkAtomicBlackBox.h.
virtual void bbtk::BlackBox::bbUserFinalizeProcessing | ( | ) | [inline, protected, virtual, inherited] |
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.
Reimplemented in bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 388 of file bbtkBlackBox.h.
virtual void bbtk::BlackBox::bbUserInitializeProcessing | ( | ) | [inline, protected, virtual, inherited] |
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
Reimplemented in bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 381 of file bbtkBlackBox.h.
virtual void bbtk::BlackBox::bbUserOnShow | ( | ) | [inline, protected, virtual, inherited] |
Definition at line 390 of file bbtkBlackBox.h.
Referenced by bbtk::WidgetBlackBox< W >::bbSetShown().
virtual void bbtk::AtomicBlackBox::bbUserProcess | ( | ) | [inline, protected, virtual] |
User callback which computes the outputs as a function of the inputs. It is assumed to be deterministic and thus is only called if the inputs have changed
Definition at line 109 of file bbtkAtomicBlackBox.h.
References bbtkWarning.
Referenced by bbtk::WidgetBlackBox< W >::bbProcess().
00110 { 00111 bbtkWarning("AtomicBlackBox::bbUserProcess() not overloaded for box '" 00112 <<bbGetFullName() 00113 <<"' : the box does nothing. Is it a bug or a feature ?" 00114 <<std::endl); 00115 }
virtual void bbtk::BlackBox::bbUserSetDefaultValues | ( | ) | [inline, protected, virtual, inherited] |
User can redefine this method to set the default values of the box inputs and outputs (it is called in the box constructor)
Reimplemented in bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 373 of file bbtkBlackBox.h.
void bbtk::BlackBox::bbWriteDotFileBlackBox | ( | FILE * | ff, | |
BlackBox::Pointer | parentblackbox, | |||
int | detail, | |||
int | level, | |||
bool | instanceOrtype, | |||
bool | relative_link | |||
) | [protected, virtual, inherited] |
Write Graphviz-dot description in file.
Write Graphviz-dot description in file. Here dumps a single box description (i/o) but overloaded in ComplexBlackBox to dump the internal pipeline representation recursing into internal boxes descriptions if level>0. detail = 1 : draw inputs and outputs (do not draw otherwise) instanceOrtype = true : draw inputs and outputs VALUES (uses bbGetInputAsString / bbGetOutputAsString which use adaptors) If relative_link is true then creates relative hrefs
Reimplemented in bbtk::ComplexBlackBox.
Definition at line 1090 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetDescriptor(), bbtk::BlackBox::bbGetInputAsString(), bbtk::BlackBox::bbGetName(), bbtk::BlackBox::bbGetOutputAsString(), bbtk::BlackBox::bbGetTypeName(), bbtk::BlackBox::bbWriteDotInputOutputName(), bbtk::Connection::GetOriginalBlackBoxFrom(), bbtk::Connection::GetOriginalBlackBoxFromOutput(), bbtk::Connection::GetOriginalBlackBoxTo(), bbtk::Connection::GetOriginalBlackBoxToInput(), bbtk::i, bbtk::BlackBox::mInputConnectorMap, bbtk::BlackBox::mOutputConnectorMap, and bbtk::SubsBrackets().
01096 { 01097 InputConnectorMapType::iterator i; 01098 // label 01099 std::string labelStr; 01100 std::string valueStr(""); 01101 01102 if (detail==0) { 01103 labelStr = bbGetName() ; 01104 //EED 18 Fev 2008 01105 labelStr = labelStr + "\\n[" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "]"; 01106 } else { 01107 labelStr = bbGetName(); 01108 labelStr = labelStr + " [" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "] "; 01109 } 01110 01111 SubsBrackets(labelStr); 01112 if (detail==1) 01113 { 01114 labelStr = labelStr + " | {{ "; 01115 std::string tempStrTypeName; 01116 bool tmp; 01117 tmp=false; 01118 for ( i = mInputConnectorMap.begin(); i != mInputConnectorMap.end(); ++i ) 01119 { 01120 if (tmp==true) 01121 { 01122 labelStr=labelStr+" | "; 01123 } 01124 tmp=true; 01125 if (instanceOrtype==true) 01126 { 01127 valueStr = this->bbGetInputAsString(i->first) + " = "; 01128 } 01129 const BlackBoxInputDescriptor* id = bbGetDescriptor()->GetInputDescriptor(i->first); 01130 tempStrTypeName=id->GetTypeName(); 01131 SubsBrackets(tempStrTypeName); 01132 std::string Name(i->first); 01133 SubsBrackets(Name); 01134 labelStr=labelStr + "<"+i->first.c_str()+"> " + valueStr + Name.c_str() + " [" + tempStrTypeName.c_str() + "]"; 01135 } 01136 labelStr=labelStr+ " } | {"; 01137 tmp = false; 01138 OutputConnectorMapType::iterator ii; 01139 for ( ii = mOutputConnectorMap.begin(); ii != mOutputConnectorMap.end(); ++ii ) 01140 { 01141 if (tmp==true) 01142 { 01143 labelStr=labelStr+" | "; 01144 } 01145 tmp = true; 01146 if (instanceOrtype==true) 01147 { 01148 valueStr = this->bbGetOutputAsString(ii->first) + " = "; 01149 } 01150 const BlackBoxOutputDescriptor* id = bbGetDescriptor()->GetOutputDescriptor(ii->first); 01151 tempStrTypeName=id->GetTypeName(); 01152 SubsBrackets(tempStrTypeName); 01153 std::string Name(ii->first); 01154 SubsBrackets(Name); 01155 labelStr=labelStr+"<"+ii->first.c_str()+"> " + valueStr + Name.c_str() + " ["+tempStrTypeName+"]"; 01156 } 01157 labelStr = labelStr+ " } }" ; 01158 } // detail 01159 01160 fprintf(ff," " ); 01161 bbWriteDotInputOutputName(ff,true,detail,level); 01162 std::string tmp ( bbGetTypeName() ); 01163 SubsBrackets(tmp); 01164 std::string url; 01165 if (relative_link) 01166 url = this->bbGetDescriptor()->GetPackage()->GetDocRelativeURL() + "#" + tmp; 01167 else 01168 url = this->bbGetDescriptor()->GetPackage()->GetDocURL() + "#" + tmp; 01169 01170 fprintf( ff , " [shape=record, URL=\"%s\",label=\"%s\"]%s\n",url.c_str(),labelStr.c_str(),";" ); 01171 // std::cout << labelStr << std::endl; 01172 01173 // Relation Input 01174 if (GetThisPointer<BlackBox>()!=parentblackbox){ 01175 for ( i = mInputConnectorMap.begin(); i != mInputConnectorMap.end(); ++i ) 01176 { 01177 if (i->second) 01178 { 01179 Connection* con = i->second->GetConnection(); 01180 if (con!=NULL){ 01181 BlackBox::Pointer a=con->GetOriginalBlackBoxFrom(); 01182 BlackBox::Pointer b=con->GetOriginalBlackBoxTo(); 01183 fprintf(ff," "); 01184 a->bbWriteDotInputOutputName(ff,false,detail,level); 01185 if (detail==1) 01186 { 01187 fprintf(ff,":%s",con->GetOriginalBlackBoxFromOutput().c_str()); 01188 } 01189 fprintf(ff,"->"); 01190 b->bbWriteDotInputOutputName(ff,true,detail,level); 01191 if (detail==1) 01192 { 01193 fprintf(ff,":%s",con->GetOriginalBlackBoxToInput().c_str()); 01194 } 01195 fprintf(ff,"%s\n",";"); 01196 } // if con 01197 } // if second 01198 } // for 01199 } // if parentblackbox 01200 }
void bbtk::BlackBox::bbWriteDotInputOutputName | ( | FILE * | ff, | |
bool | inputoutput, | |||
int | detail, | |||
int | level | |||
) | [protected, virtual, inherited] |
Auxiliary method for bbWriteDotFileBlackBox.
Reimplemented in bbtk::ComplexBlackBox.
Definition at line 951 of file bbtkBlackBox.cxx.
References bbtk::BlackBox::bbGetTypeName().
Referenced by bbtk::BlackBox::bbWriteDotFileBlackBox().
00952 { 00953 fprintf(ff,"%s%p",bbGetTypeName().c_str(),this); 00954 }
void bbtk::BlackBox::Check | ( | bool | recursive = true |
) | [protected, virtual, inherited] |
Reimplemented in bbtk::ComplexBlackBox.
Definition at line 1443 of file bbtkBlackBox.cxx.
References bbtkBlackBoxMessage.
01444 { 01445 bbtkBlackBoxMessage("debug",1,"*** Checking" 01446 <<" ... OK"<<std::endl); 01447 }
std::string bbtk::AtomicBlackBox::GetObjectInfo | ( | ) | const [virtual] |
Reimplemented from bbtk::Object.
Definition at line 174 of file bbtkAtomicBlackBox.cxx.
References bbtk::i.
00175 { 00176 std::stringstream i; 00177 return i.str(); 00178 }
virtual size_t bbtk::Object::GetObjectInternalSize | ( | ) | const [inline, virtual, inherited] |
Reimplemented in bbtk::ComplexBlackBox, bbtk::ComplexBlackBoxDescriptor, bbtk::Connection, bbtk::Executer, bbtk::Factory, bbtk::Interpreter, bbtk::InterpreterVirtual, bbtk::Package, and bbtk::Transcriptor.
Definition at line 61 of file bbtkObject.h.
00061 { return sizeof(Object); }
std::string bbtk::Object::GetObjectName | ( | ) | const [virtual, inherited] |
Reimplemented in bbtk::ComplexBlackBox, bbtk::ComplexBlackBoxDescriptor, bbtk::Connection, bbtk::Executer, bbtk::Factory, bbtk::Interpreter, bbtk::InterpreterVirtual, bbtk::Package, bbtk::QtBlackBox, bbtk::QtBlackBoxDescriptor, bbtk::Transcriptor, bbtk::WidgetBlackBox< W >, bbtk::WidgetBlackBoxDescriptor< T >, bbtk::WxBlackBox, bbtk::WxBlackBoxDescriptor, bbtk::WidgetBlackBox< QWidget >, bbtk::WidgetBlackBox< wxWindow >, bbtk::WidgetBlackBoxDescriptor< QWidget >, and bbtk::WidgetBlackBoxDescriptor< wxWindow >.
Definition at line 91 of file bbtkObject.cxx.
Referenced by bbtk::BlackBox::Deleter::Delete(), and bbtk::Object::Deleter::operator()().
size_t bbtk::AtomicBlackBox::GetObjectRecursiveSize | ( | ) | const [virtual] |
Reimplemented from bbtk::Object.
Definition at line 189 of file bbtkAtomicBlackBox.cxx.
References GetObjectSize().
00190 { 00191 size_t s = GetObjectSize(); 00192 return s; 00193 }
static long bbtk::Object::GetObjectsCount | ( | ) | [inline, static, inherited] |
Definition at line 75 of file bbtkObject.h.
Referenced by bbtk::StaticInitTime::~StaticInitTime().
00075 { return mgObjectList.size(); }
size_t bbtk::AtomicBlackBox::GetObjectSize | ( | ) | const [virtual] |
Reimplemented from bbtk::Object.
Definition at line 182 of file bbtkAtomicBlackBox.cxx.
Referenced by GetObjectRecursiveSize().
boost::shared_ptr<U> bbtk::Object::GetThisPointer | ( | ) | const [inline, protected, inherited] |
Definition at line 92 of file bbtkObject.h.
00093 { 00094 return boost::dynamic_pointer_cast<U>(mThisPointer.lock()); 00095 }
long bbtk::Object::GetUseCount | ( | ) | [inline, inherited] |
void bbtk::Object::InsertInObjectList | ( | Pointer | p | ) | [static, inherited] |
Definition at line 59 of file bbtkObject.cxx.
References bbtkDebugMessage, and bbtk::Object::mgObjectList.
Referenced by bbtk::Object::MakePointer().
00060 { 00061 bbtkDebugMessage("object",9,"##> Object::InsertInObjectList(\"" 00062 <<p->GetObjectName()<<"\" ["<<p<<"])"<<std::endl); 00063 boost::weak_ptr<Object> w(p); 00064 mgObjectList.insert(w); 00065 }
void bbtk::Object::InsertInPackageList | ( | Pointer | p | ) | [static, inherited] |
Definition at line 69 of file bbtkObject.cxx.
References bbtkDebugMessage, and bbtk::Object::mgPackageList.
00070 { 00071 bbtkDebugMessage("object",9,"##> Object::InsertInPackageList(\"" 00072 <<p->GetObjectName()<<"\" ["<<p<<"])"<<std::endl); 00073 boost::weak_ptr<Object> w(p); 00074 mgPackageList.insert(w); 00075 }
void bbtk::Object::LockThis | ( | ) | [inline, protected, inherited] |
static boost::shared_ptr<U> bbtk::BlackBox::MakeBlackBoxPointer | ( | U * | s, | |
bool | lock = false | |||
) | [inline, static, protected, inherited] |
Like Object::MakePointer but returns a boost::shared_pointer which uses a BlackBox::Deleter to delete the object instead of the default Object::Deleter.
Definition at line 609 of file bbtkBlackBox.h.
Referenced by bbtk::BlackBox::bbAllocateConnectors(), bbtk::ComplexBlackBox::bbClone(), bbtk::ComplexBlackBox::ComplexBlackBox(), and bbtk::ComplexBlackBox::New().
00610 { 00611 return MakePointer(s,BlackBox::Deleter(),lock); 00612 }
static boost::shared_ptr<U> bbtk::Object::MakePointer | ( | U * | s, | |
const D & | del, | |||
bool | lock = false | |||
) | [inline, static, protected, inherited] |
Definition at line 115 of file bbtkObject.h.
References bbtk::Object::InsertInObjectList().
00118 { 00119 if (s->mThisPointer.lock()) 00120 { 00121 boost::shared_ptr<U> p = s->GetThisPointer<U>(); 00122 if (!lock) s->mThisPointerLocked.reset(); 00123 return p; 00124 } 00125 boost::shared_ptr<U> p = boost::shared_ptr<U>(s,del); 00126 static_cast<D*> 00127 (p._internal_get_deleter(typeid(D))) 00128 ->mPointer = p; 00129 s->mThisPointer = p; 00130 Object::InsertInObjectList(p); 00131 if (lock) s->LockThis(); 00132 return p; 00133 }
static boost::shared_ptr<U> bbtk::Object::MakePointer | ( | U * | s, | |
bool | lock = false | |||
) | [inline, static, protected, inherited] |
Definition at line 97 of file bbtkObject.h.
References bbtk::Object::InsertInObjectList().
Referenced by bbtk::ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor(), bbtk::Executer::Executer(), bbtk::Interpreter::Init(), bbtk::Transcriptor::New(), bbtk::Package::New(), bbtk::InterpreterVirtual::New(), bbtk::Interpreter::New(), bbtk::Factory::New(), bbtk::Executer::New(), and bbtk::ComplexBlackBoxDescriptor::New().
00098 { 00099 if (s->mThisPointer.lock()) 00100 { 00101 boost::shared_ptr<U> p = s->GetThisPointer<U>(); 00102 if (!lock) s->mThisPointerLocked.reset(); 00103 return p; 00104 } 00105 boost::shared_ptr<U> p = boost::shared_ptr<U>(s,Object::Deleter()); 00106 static_cast<Object::Deleter*> 00107 (p._internal_get_deleter(typeid(Object::Deleter))) 00108 ->mPointer = p; 00109 s->mThisPointer = p; 00110 Object::InsertInObjectList(p); 00111 if (lock) s->LockThis(); 00112 return p; 00113 }
void bbtk::Object::PrintObjectInfo | ( | const Pointer & | o | ) | [static, inherited] |
Definition at line 180 of file bbtkObject.cxx.
Referenced by bbtk::Object::PrintObjectListInfo().
00181 { 00182 std::cout << "* [" << p << "] \t" 00183 << p.use_count()-1 << " r \t" 00184 << p->GetObjectRecursiveSize() << " (" 00185 << p->GetObjectSize() << ") b \t" 00186 << p->GetObjectName() 00187 << std::endl; 00188 std::cout << p->GetObjectInfo(); 00189 }
void bbtk::Object::PrintObjectListInfo | ( | const std::string & | name | ) | [static, inherited] |
Definition at line 105 of file bbtkObject.cxx.
References bbtk::i, bbtk::Object::mgObjectList, and bbtk::Object::PrintObjectInfo().
Referenced by bbtk::Interpreter::commandDebug().
00106 { 00107 00108 std::cout 00109 << "=============== Living bbtk::Object pointers ========="<<std::endl; 00110 00111 long n = 0; 00112 long u = 0; 00113 size_t m = 0; 00114 ObjectListType::iterator i; 00115 for (i = mgObjectList.begin(); 00116 i!=mgObjectList.end(); 00117 ++i) 00118 { 00119 if (i->use_count() == 0) 00120 { 00121 u++; 00122 } 00123 else 00124 { 00125 Object::Pointer p(i->lock()); 00126 if (p->GetObjectName().find(name) != std::string::npos ) 00127 { 00128 std::cout << n << "/" << mgObjectList.size() << " "; 00129 PrintObjectInfo(p); 00130 m += p->GetObjectSize(); 00131 n++; 00132 } 00133 } 00134 } 00135 std::cout 00136 << "------------------------------------------------------"<<std::endl; 00137 00138 std::cout << " Total : "<<n<<" objects - "<<m<<" b"<<std::endl; 00139 if (u==1) 00140 { 00141 std::cout<<"* Note : "<<u 00142 <<" object in list has 0 ref count, " 00143 <<"i.e. are no more accessible by bbtk but did not properly destroyed because another ref counting system is holding them !"<<std::endl; 00144 } 00145 else if (u>1) 00146 { 00147 std::cout<<"* Note : "<<u 00148 <<" objects in list have 0 ref count, " 00149 <<"i.e. are no more accessible by bbtk but did not properly destroyed because another ref counting system is holding them !"<<std::endl; 00150 } 00151 std::cout 00152 << "============ EO Living bbtk::Object pointers ========="<<std::endl; 00153 00154 }
void bbtk::Object::ReleasePackages | ( | ) | [static, inherited] |
Definition at line 222 of file bbtkObject.cxx.
References bbtkDebugMessage, bbtk::i, bbtk::Object::mgPackageList, and bbtk::Package::Release().
Referenced by bbtk::StaticInitTime::~StaticInitTime().
00223 { 00224 bbtkDebugMessage("object",1,"##> Object::ReleasePackages()"<<std::endl); 00225 // Release package pointers 00226 ObjectListType::iterator i; 00227 for (i = mgPackageList.begin(); 00228 i!= mgPackageList.end(); 00229 ++i) 00230 { 00231 if (i->use_count() != 0) 00232 { 00233 bbtkDebugMessage("object",1,"##> Releasing package '"<< 00234 i->lock()->GetThisPointer<Package>()->GetName() 00235 <<"'"<<std::endl); 00236 // Object::Pointer p(i->lock()); 00237 Package::WeakPointer w(i->lock()->GetThisPointer<Package>()); 00238 Package::Release(w); 00239 /* 00240 if (p->GetObjectName().find(name) != std::string::npos ) 00241 { 00242 std::cout << n << "/" << mgObjectList.size() << " "; 00243 PrintObjectInfo(p); 00244 m += p->GetObjectSize(); 00245 n++; 00246 } 00247 */ 00248 } 00249 } 00250 00251 }
void bbtk::Object::RemoveFromObjectList | ( | WeakPointer | p | ) | [static, inherited] |
Definition at line 80 of file bbtkObject.cxx.
References bbtkDebugMessage, and bbtk::Object::mgObjectList.
Referenced by bbtk::Object::Deleter::operator()().
00081 { 00082 bbtkDebugMessage("object",9,"##> Object::RemoveFromObjectList()" 00083 <<std::endl); 00084 mgObjectList.erase(p); 00085 00086 }
void bbtk::Object::UnLockThis | ( | ) | [inline, protected, inherited] |
friend struct Object::Deleter [friend, inherited] |
Reimplemented in bbtk::ComplexBlackBox, bbtk::QtBlackBox, bbtk::WidgetBlackBox< W >, bbtk::WxBlackBox, bbtk::WidgetBlackBox< QWidget >, and bbtk::WidgetBlackBox< wxWindow >.
Definition at line 74 of file bbtkBlackBox.h.
Definition at line 144 of file bbtkAtomicBlackBox.h.