#include <bbtkBlackBox.h>
Public Types | |
enum | BoxProcessModeValue { Pipeline, Always, Reactive } |
typedef BlackBox | Self |
typedef boost::shared_ptr< Self > | Pointer |
typedef boost::weak_ptr< Self > | WeakPointer |
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 | |
virtual BlackBoxDescriptor::Pointer | bbGetDescriptor () const =0 |
Returns the pointer on the descriptor of the box. | |
virtual BlackBox::Pointer | bbClone (const std::string &name)=0 |
Returns a pointer on a clone of the box with name <name>. | |
virtual void | bbUserDelete () |
User overloadable destruction method of a black 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). | |
virtual void | bbExecute (bool force=false) |
Main processing method of the box. | |
virtual void | bbSetModifiedStatus (BlackBoxInputConnector *c=0) |
Signals that the BlackBox has been modified. | |
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) |
virtual const IOStatus & | bbGetStatus () const |
Gets the status of the box. | |
virtual bool | bbHasInput (const std::string &label) const |
Returns true iff the BlackBox has an input of name label. | |
virtual bool | bbHasOutput (const std::string &label) const |
Returns true iff the BlackBox has an output of name label. | |
virtual TypeInfo | bbGetInputType (const std::string &label) const |
Gets the input type of a given label. | |
virtual TypeInfo | bbGetOutputType (const std::string &label) const |
Gets the output type of a given label. | |
virtual Data | bbGetInput (const std::string &name)=0 |
Gets the data of the input called <name>. | |
virtual Data | bbGetOutput (const std::string &name)=0 |
Gets the data of the output called <name>. | |
virtual void | bbSetInput (const std::string &name, Data data, bool setModified=true)=0 |
virtual void | bbBruteForceSetInputPointer (const std::string &name, void *data, bool setModified=true)=0 |
virtual void | bbSetOutput (const std::string &name, Data data)=0 |
Sets the data of the output called <name>. | |
InputConnectorMapType & | bbGetInputConnectorMap () |
Returns the input connectors map. | |
OutputConnectorMapType & | bbGetOutputConnectorMap () |
Returns the output connectors map. | |
const InputConnectorMapType & | bbGetInputConnectorMap () const |
Returns the input connectors map (const). | |
const OutputConnectorMapType & | bbGetOutputConnectorMap () const |
Returns the output connectors map (const). | |
virtual void | bbGetHelp (bool full=true) const |
Prints the Help on the BlackBox type. | |
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 |
virtual bool | bbBoxProcessModeIsAlways () const |
Void | bbGetInputBoxExecute () |
Returns the value of the input "Execute". | |
void | bbSetInputBoxExecute (Void=0) |
Sets the value of the input "Execute". | |
Void | bbGetOutputBoxChange () |
Returns the value of the output "Change". | |
void | bbSetOutputBoxChange (Void=0) |
Sets the value of the output "Change" : signal a modification. | |
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 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 void | bbShowRelations (BlackBox::Pointer parentblackbox, int detail, int level) |
std::string | bbGetOutputAsString (const std::string &output) |
std::string | bbGetInputAsString (const std::string &input) |
virtual BlackBox::Pointer | bbFindBlackBox (const std::string &blackboxname) |
virtual void | Check (bool recursive=true) |
virtual void | bbUserOnShow () |
void | bbUserOnShowWidget (std::string nameInput) |
virtual bool | bbCanReact () const |
virtual std::string | GetObjectName () const |
virtual std::string | GetObjectInfo () const |
virtual size_t | GetObjectSize () const |
virtual size_t | GetObjectInternalSize () const |
virtual size_t | GetObjectRecursiveSize () const |
long | GetUseCount () |
Static Public Member Functions | |
static bool | bbGlobalGetSomeBoxExecuting () |
static void | bbGlobalSetSomeBoxExecuting (bool b) |
static void | bbGlobalSetFreezeExecution (bool b) |
static bool | bbGlobalGetFreezeExecution () |
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 () |
Protected Member Functions | |
BlackBox () | |
BlackBox (const BlackBox &) | |
virtual | ~BlackBox () |
BlackBox (const std::string &name) | |
Constructor that take the BlackBox's name. | |
BlackBox (BlackBox &from, const std::string &name) | |
Constructor from an existing box (copy) with a new name. | |
void | bbSetStatus (IOStatus t) |
Sets the status of the box. | |
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. | |
virtual void | bbDelete () |
void | LockThis () |
void | UnLockThis () |
template<class U> | |
boost::shared_ptr< U > | GetThisPointer () const |
Pipeline processing methods | |
Methods which participate to (forward or backward) pipeline processing. Some are pure virtual and prepare particular update mechanism which are implemented by descendents (e.g. ForwardUpdate and UpdateChildren are made for WxContainerBlackBox particular update mechanism which must recurse a piece of the pipeline top-down). The main method is bbBackwardUpdate which is called by bbExecute and implemented in UserBlackBox and ComplexBlackBox. | |
virtual IOStatus | bbBackwardUpdate (Connection::Pointer caller)=0 |
IOStatus | bbUpdateInputs (bool excludeParent=false) |
virtual void | bbShowWindow (Connection::Pointer caller) |
virtual void | bbHideWindow () |
virtual void | bbCloseWindow () |
Static Protected Member Functions | |
static void | bbGlobalAddToExecutionList (BlackBox::Pointer b) |
static void | bbGlobalProcessExecutionList () |
template<class U> | |
static boost::shared_ptr< U > | MakeBlackBoxPointer (U *s, bool lock=false) |
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) |
Private Member Functions | |
void | bbSetParent (BlackBox::Pointer p) |
Sets the parent of the BlackBox. | |
virtual void | bbConnectInput (const std::string &name, Connection *c) |
Connects the input <name> to the connection c. | |
virtual void | bbConnectOutput (const std::string &name, Connection *c) |
Connects the output <name> to the connection c. | |
virtual void | bbDisconnectInput (const std::string &name, Connection *c) |
Disconnects the input <name> from the connection c. | |
virtual void | bbDisconnectOutput (const std::string &name, Connection *c) |
Disconnects the output <name> from the connection c. | |
Private Attributes | |
IOStatus | bbmStatus |
The status of the box. | |
std::string | bbmName |
The name of the black-box. | |
std::string | bbmPackageName |
The name of the package to which it belongs. | |
std::string | bbmBoxProcessMode |
BlackBox::WeakPointer | bbmParent |
The parent of the black box in the ComplexBlackBox hierarchy. | |
OutputConnectorMapType | mOutputConnectorMap |
Map that contains the output connectors of the black box. | |
InputConnectorMapType | mInputConnectorMap |
Map that contains the input connectors of the black box. | |
Friends | |
struct | Object::Deleter |
class | Connection |
class | ComplexBlackBox |
Classes | |
struct | Deleter |
Definition at line 61 of file bbtkBlackBox.h.
typedef BlackBox bbtk::BlackBox::Self |
Definition at line 63 of file bbtkBlackBox.h.
typedef boost::shared_ptr<Self> bbtk::BlackBox::Pointer |
typedef boost::weak_ptr<Self> bbtk::BlackBox::WeakPointer |
typedef std::map<std::string, BlackBoxOutputConnector*> bbtk::BlackBox::OutputConnectorMapType |
typedef std::map<std::string, BlackBoxInputConnector*> bbtk::BlackBox::InputConnectorMapType |
enum bbtk::BlackBox::BoxProcessModeValue |
bbtk::BlackBox::BlackBox | ( | ) | [protected] |
bbtk::BlackBox::BlackBox | ( | const BlackBox & | ) | [protected] |
bbtk::BlackBox::~BlackBox | ( | ) | [protected, virtual] |
Definition at line 142 of file bbtkBlackBox.cxx.
References bbDesallocateConnectors(), bbmName, and bbtkDebugMessage.
00143 { 00144 bbtkDebugMessage("object",4,"==> BlackBox::~BlackBox() ["<<bbmName 00145 <<"]"<<std::endl); 00146 this->bbDesallocateConnectors(); 00147 bbtkDebugMessage("object",4,"<== BlackBox::~BlackBox() ["<<bbmName 00148 <<"]"<<std::endl); 00149 }
bbtk::BlackBox::BlackBox | ( | const std::string & | name | ) | [protected] |
Constructor that take the BlackBox's name.
Definition at line 103 of file bbtkBlackBox.cxx.
References bbtkDebugMessage.
00104 : 00105 bbmStatus(MODIFIED), 00106 bbmName(name), 00107 bbmBoxProcessMode("Pipeline"), 00108 bbmParent() 00109 00110 { 00111 bbtkDebugMessage("object",4,"==> BlackBox::BlackBox(\"" 00112 <<name<<"\")"<<std::endl); 00113 bbtkDebugMessage("object",4,"<== BlackBox::BlackBox(\"" 00114 <<name<<"\")"<<std::endl); 00115 }
bbtk::BlackBox::BlackBox | ( | BlackBox & | from, | |
const std::string & | name | |||
) | [protected] |
Constructor from an existing box (copy) with a new name.
Definition at line 123 of file bbtkBlackBox.cxx.
References bbGetFullName(), bbmBoxProcessMode, bbmName, bbmParent, bbmStatus, and bbtkDebugMessage.
00124 : 00125 bbmStatus(from.bbmStatus), 00126 bbmName(name), 00127 bbmBoxProcessMode(from.bbmBoxProcessMode), 00128 bbmParent() 00129 00130 { 00131 bbtkDebugMessage("object",4,"==> BlackBox::BlackBox(" 00132 <<from.bbGetFullName()<<",\"" 00133 <<name<<"\")"<<std::endl); 00134 bbtkDebugMessage("object",4,"<== BlackBox::BlackBox(" 00135 <<from.bbGetFullName()<<",\"" 00136 <<name<<"\")"<<std::endl); 00137 } //=========================================================================
virtual BlackBoxDescriptor::Pointer bbtk::BlackBox::bbGetDescriptor | ( | ) | const [pure virtual] |
Returns the pointer on the descriptor of the box.
Referenced by bbAllocateConnectors(), bbCopyIOValues(), bbGetFullName(), bbGetHelp(), bbGetInputAsString(), bbGetInputType(), bbGetOutputAsString(), bbGetOutputType(), bbHasInput(), bbHasOutput(), bbShowRelations(), bbWriteDotFileBlackBox(), and bbtk::BlackBox::Deleter::Delete().
virtual BlackBox::Pointer bbtk::BlackBox::bbClone | ( | const std::string & | name | ) | [pure virtual] |
Returns a pointer on a clone of the box with name <name>.
void bbtk::BlackBox::bbUserDelete | ( | ) | [virtual] |
User overloadable destruction method of a black box.
Definition at line 384 of file bbtkBlackBox.cxx.
References bbGetFullName(), and bbtkDebugMessage.
00385 { 00386 bbtkDebugMessage("process",5, 00387 "=> BlackBox::bbUserDelete() [" 00388 <<bbGetFullName()<<"]" 00389 <<" : not overloaded; using standard deletion" 00390 <<std::endl); 00391 delete this; 00392 }
const std::string& bbtk::BlackBox::bbGetTypeName | ( | ) | const [inline] |
Returns the Name of the Type of the BlackBox.
Definition at line 86 of file bbtkBlackBox.h.
Referenced by bbWriteDotFileBlackBox(), and bbWriteDotInputOutputName().
00087 { return bbGetDescriptor()->GetTypeName(); }
const std::string& bbtk::BlackBox::bbGetName | ( | ) | const [inline] |
Returns the name of the BlackBox (instance).
Definition at line 91 of file bbtkBlackBox.h.
Referenced by bbShowRelations(), and bbWriteDotFileBlackBox().
00091 { return bbmName; }
std::string bbtk::BlackBox::bbGetFullName | ( | ) | const [virtual] |
Returns the full name of the BlackBox (instance+type).
Definition at line 184 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), and bbGetNameWithParent().
Referenced by bbAllocateConnectors(), bbConnectInput(), bbConnectOutput(), bbCopyIOValues(), bbDisconnectInput(), bbDisconnectOutput(), bbExecute(), bbGetBoxProcessModeValue(), bbGetInputType(), bbGetOutputType(), bbHasInput(), bbHasOutput(), bbSetModifiedStatus(), bbSignalOutputModification(), bbUpdateInputs(), bbUserDelete(), BlackBox(), and Check().
00185 { 00186 return this->bbGetNameWithParent()+"<"+this->bbGetDescriptor()->GetTypeName()+">"; 00187 }
std::string bbtk::BlackBox::bbGetNameWithParent | ( | ) | const [virtual] |
Returns the name with the name of the parent prepended if any.
Definition at line 194 of file bbtkBlackBox.cxx.
References bbmName, and bbmParent.
Referenced by bbGetFullName().
00195 { 00196 if (bbmParent.lock()) 00197 { 00198 return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName; 00199 } 00200 else 00201 { 00202 return bbmName; 00203 } 00204 }
BlackBox::Pointer bbtk::BlackBox::bbGetParent | ( | ) | const [inline] |
Returns the parent of the BlackBox, i.e the BlackBox that contains it (0 if none).
Definition at line 100 of file bbtkBlackBox.h.
00100 { return bbmParent.lock(); }
void bbtk::BlackBox::bbExecute | ( | bool | force = false |
) | [virtual] |
Main processing method of the box.
Definition at line 155 of file bbtkBlackBox.cxx.
References bbBackwardUpdate(), bbGetFullName(), bbGlobalGetFreezeExecution(), bbSetModifiedStatus(), BBTK_BUSY_CURSOR, bbtkDebugMessage, bbtkDebugMessageDec, and bbtkDebugMessageInc.
00156 { 00157 bbtkDebugMessageInc("process",2, 00158 "=> BlackBox::bbExecute() [" 00159 <<bbGetFullName()<<"]"<<std::endl); 00160 00161 00162 // If execution frozen : return 00163 if (bbGlobalGetFreezeExecution()) 00164 { 00165 bbtkDebugMessage("process",2, 00166 " -> FreezeExecution global flag is 'true' : abort execution"<<std::endl); 00167 } 00168 00169 BBTK_BUSY_CURSOR; 00170 00171 // If force is true then update is triggered even if the box is UPTODATE 00172 if (force) bbSetModifiedStatus(); 00173 00174 // Calls the main recursive update method 00175 bbBackwardUpdate(Connection::Pointer()); 00176 00177 bbtkDebugMessageDec("process",2, 00178 "<= BlackBox::bbExecute() [" 00179 <<bbGetFullName()<<"]"<<std::endl); 00180 }
void bbtk::BlackBox::bbSetModifiedStatus | ( | BlackBoxInputConnector * | c = 0 |
) | [virtual] |
Signals that the BlackBox has been modified.
Signals that the BlackBox has been modified through the input connector c and propagates it downward
Definition at line 433 of file bbtkBlackBox.cxx.
References bbBoxProcessModeIsReactive(), bbCanReact(), bbGetFullName(), bbGetInputConnectorMap(), bbGlobalAddToExecutionList(), bbHideWindow(), bbSetStatus(), bbSignalOutputModification(), bbtkDebugMessage, and bbtk::MODIFIED.
Referenced by bbExecute().
00434 { 00435 bbtkDebugMessage("modified",1, 00436 "==> BlackBox::bbSetModifiedStatus("<<c<<") [" 00437 <<bbGetFullName()<<"]"<<std::endl); 00438 00439 if ( (c==bbGetInputConnectorMap().find("WinHide")->second) ) 00440 // && (bbCanReact())) 00441 { 00442 bbtkDebugMessage("modified",2, 00443 "-> Hide triggered by WinHide input change" 00444 <<std::endl); 00445 this->bbHideWindow(); 00446 this->bbSetStatus(MODIFIED); 00447 return; 00448 } 00449 if ( (c==bbGetInputConnectorMap().find("WinClose")->second) ) 00450 // && (bbCanReact())) 00451 { 00452 bbtkDebugMessage("modified",2, 00453 "-> Close triggered by WinClose input change" 00454 <<std::endl); 00455 this->bbHideWindow(); 00456 this->bbSetStatus(MODIFIED); 00457 return; 00458 } 00459 00460 if ( ( bbBoxProcessModeIsReactive() || 00461 (c==bbGetInputConnectorMap().find("BoxExecute")->second)) 00462 && (bbCanReact() ) ) 00463 { 00464 bbtkDebugMessage("modified",2, 00465 "-> Execution triggered by Reactive mode or BoxExecute input change"<<std::endl); 00466 this->bbSetStatus(MODIFIED); 00467 bbGlobalAddToExecutionList( GetThisPointer<BlackBox>() ); 00468 } 00469 /* 00470 else if ( bbGetStatus() == MODIFIED ) //! this->bbIsUptodate()) 00471 { 00472 bbtkDebugMessage("modified",2,"-> Already modified"<<std::endl); 00473 return; 00474 } 00475 */ 00476 else 00477 { 00478 bbtkDebugMessage("modified",2,"-> Status set to modified"<<std::endl); 00479 this->bbSetStatus(MODIFIED); 00480 } 00481 00482 this->bbSignalOutputModification(false); 00483 00484 /* 00485 bbtkDebugMessageDec("process",5, 00486 "<= BlackBox::bbSetModifiedStatus("<<c<<") [" 00487 <<bbGetFullName()<<"]"<<std::endl); 00488 */ 00489 }
void bbtk::BlackBox::bbSignalOutputModification | ( | bool | reaction = true |
) | [virtual] |
Signals that the BlackBox outputs have been modified 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 **ALL** outputs have been modified (after the outputs has been updated !)
Definition at line 493 of file bbtkBlackBox.cxx.
References bbGetFullName(), bbGetOutputConnectorMap(), bbGlobalProcessExecutionList(), bbtkDebugMessageDec, bbtkDebugMessageInc, and bbtk::i.
Referenced by bbSetModifiedStatus().
00494 { 00495 bbtkDebugMessageInc("process",5, 00496 "=> BlackBox::bbSignalOutputModification() [" 00497 <<bbGetFullName()<<"]"<<std::endl); 00498 00499 OutputConnectorMapType::iterator change = bbGetOutputConnectorMap().end(); 00500 OutputConnectorMapType::iterator i; 00501 for ( i = bbGetOutputConnectorMap().begin(); 00502 i != bbGetOutputConnectorMap().end(); ++i) { 00503 /* if ( i->first == "BoxChange" ) 00504 { 00505 change = i; 00506 continue; 00507 } 00508 */ 00509 i->second->SetModifiedStatus(); 00510 } 00511 // if (change != bbGetOutputConnectorMap().end()) 00512 // change->second->SetModifiedStatus(); 00513 00514 if (reaction) bbGlobalProcessExecutionList(); 00515 00516 bbtkDebugMessageDec("process",5, 00517 "<= BlackBox::bbSignalOutputModification() [" 00518 <<bbGetFullName()<<"]"<<std::endl); 00519 00520 }
void bbtk::BlackBox::bbSignalOutputModification | ( | const std::string & | output_name, | |
bool | reaction = true | |||
) | [virtual] |
Signals that the BlackBox output "output_name" have been modified without marking the box as MODIFIED because its output state is ok. 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 !)
Definition at line 523 of file bbtkBlackBox.cxx.
References bbGetFullName(), bbGetOutputConnectorMap(), bbGlobalProcessExecutionList(), bbtkDebugMessageDec, bbtkDebugMessageInc, bbtkError, and bbtk::i.
00525 { 00526 bbtkDebugMessageInc("process",5, 00527 "=> BlackBox::bbSignalOutputModification(" 00528 <<output<<") [" 00529 <<bbGetFullName()<<"]"<<std::endl); 00530 00531 OutputConnectorMapType::iterator i = bbGetOutputConnectorMap().find(output); 00532 if ( i == bbGetOutputConnectorMap().end() ) 00533 { 00534 bbtkError("BlackBox["<<bbGetFullName()<<"]::bbSignalOutputModification("<<output<<") : unknown output"); 00535 } 00536 i->second->SetModifiedStatus(); 00537 // Has to notify the output "BoxChange" also 00538 if (output != "BoxChange") 00539 { 00540 i = bbGetOutputConnectorMap().find("BoxChange"); 00541 if ( i != bbGetOutputConnectorMap().end() ) 00542 { 00543 i->second->SetModifiedStatus(); 00544 } 00545 } 00546 if (reaction) bbGlobalProcessExecutionList(); 00547 00548 bbtkDebugMessageDec("process",5, 00549 "<= BlackBox::bbSignalOutputModification(" 00550 <<output<<") [" 00551 <<bbGetFullName()<<"]"<<std::endl); 00552 00553 }
void bbtk::BlackBox::bbSignalOutputModification | ( | const std::vector< std::string > & | output_name, | |
bool | reaction = true | |||
) | [virtual] |
Signals that the BlackBox vector of outputs "output_name" have been modified 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!)
Definition at line 556 of file bbtkBlackBox.cxx.
References bbGetFullName(), bbGetOutputConnectorMap(), bbGlobalProcessExecutionList(), bbtkDebugMessageDec, bbtkDebugMessageInc, bbtkError, and bbtk::i.
00558 { 00559 bbtkDebugMessageInc("process",5, 00560 "=> BlackBox::bbSignalOutputModification(vector of outputs) [" 00561 <<bbGetFullName()<<"]"<<std::endl); 00562 OutputConnectorMapType::iterator i; 00563 std::vector<std::string>::const_iterator o; 00564 for (o=output.begin();o!=output.end();++o) 00565 { 00566 // the output "BoxChange" must be signaled **AFTER** all others 00567 if (*o == "BoxChange") continue; 00568 // Look for the connector 00569 i = bbGetOutputConnectorMap().find(*o); 00570 if ( i == bbGetOutputConnectorMap().end() ) 00571 { 00572 bbtkError("BlackBox["<<bbGetFullName()<<"]::bbSignalOutputModification("<<*o<<") : unknown output"); 00573 } 00574 i->second->SetModifiedStatus(); 00575 } 00576 // Has to notify the output "BoxChange" also 00577 i = bbGetOutputConnectorMap().find("BoxChange"); 00578 if ( i != bbGetOutputConnectorMap().end() ) 00579 { 00580 i->second->SetModifiedStatus(); 00581 } 00582 if (reaction) bbGlobalProcessExecutionList(); 00583 00584 bbtkDebugMessageDec("process",5, 00585 "<= BlackBox::bbSignalOutputModification(vector of outputs) [" 00586 <<bbGetFullName()<<"]"<<std::endl); 00587 00588 }
virtual const IOStatus& bbtk::BlackBox::bbGetStatus | ( | ) | const [inline, virtual] |
Gets the status of the box.
Definition at line 132 of file bbtkBlackBox.h.
00132 { return bbmStatus; }
bool bbtk::BlackBox::bbHasInput | ( | const std::string & | label | ) | const [virtual] |
Returns true iff the BlackBox has an input of name label.
Returns true if the UserBlackBox has an input of name name.
Definition at line 218 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), bbGetFullName(), bbtkDebugDecTab, and bbtkDebugMessageInc.
00219 { 00220 bbtkDebugMessageInc("Kernel",8, 00221 "BlackBox::bbHasInput(\"" 00222 <<name<<"\") ["<<bbGetFullName()<<"]" 00223 <<std::endl); 00224 bool r = ( bbGetDescriptor()->GetInputDescriptorMap().find(name) 00225 != bbGetDescriptor()->GetInputDescriptorMap().end()); 00226 bbtkDebugDecTab("Kernel",8); 00227 return r; 00228 }
bool bbtk::BlackBox::bbHasOutput | ( | const std::string & | label | ) | const [virtual] |
Returns true iff the BlackBox has an output of name label.
Returns true if the UserBlackBox has an output of name name.
Definition at line 234 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), bbGetFullName(), bbtkDebugDecTab, and bbtkDebugMessageInc.
00235 { 00236 bbtkDebugMessageInc("Kernel",8,"BlackBox::bbHasOutput(\"" 00237 <<name<<"\") ["<<bbGetFullName()<<"]"<<std::endl); 00238 bool r = ( bbGetDescriptor()->GetOutputDescriptorMap().find(name) 00239 != bbGetDescriptor()->GetOutputDescriptorMap().end()); 00240 bbtkDebugDecTab("Kernel",8); 00241 return r; 00242 }
TypeInfo bbtk::BlackBox::bbGetInputType | ( | const std::string & | label | ) | const [virtual] |
Gets the input type of a given label.
Gets the input type of a given name.
Definition at line 261 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), bbGetFullName(), bbtkDebugDecTab, and bbtkDebugMessageInc.
Referenced by bbGetInputAsString().
00262 { 00263 bbtkDebugMessageInc("Kernel",8, 00264 "BlackBox::bbGetInputType(\"" 00265 <<name<<"\") ["<<bbGetFullName()<<"]"<<std::endl); 00266 TypeInfo r = bbGetDescriptor()->GetInputDescriptor(name)->GetTypeInfo(); 00267 bbtkDebugDecTab("Kernel",8); 00268 return r; 00269 }
TypeInfo bbtk::BlackBox::bbGetOutputType | ( | const std::string & | label | ) | const [virtual] |
Gets the output type of a given label.
Gets the output type of a given name.
Definition at line 248 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), bbGetFullName(), bbtkDebugDecTab, and bbtkDebugMessageInc.
Referenced by bbGetOutputAsString().
00249 { 00250 bbtkDebugMessageInc("Kernel",8, 00251 "BlackBox::bbGetOutputType(\"" 00252 <<name<<"\") ["<<bbGetFullName()<<"]"<<std::endl); 00253 TypeInfo r = bbGetDescriptor()->GetOutputDescriptor(name)->GetTypeInfo(); 00254 bbtkDebugDecTab("Kernel",8); 00255 return r; 00256 }
virtual Data bbtk::BlackBox::bbGetInput | ( | const std::string & | name | ) | [pure virtual] |
Gets the data of the input called <name>.
Referenced by bbCopyIOValues(), and bbGetInputAsString().
virtual Data bbtk::BlackBox::bbGetOutput | ( | const std::string & | name | ) | [pure virtual] |
Gets the data of the output called <name>.
Referenced by bbCopyIOValues(), and bbGetOutputAsString().
virtual void bbtk::BlackBox::bbSetInput | ( | const std::string & | name, | |
Data | data, | |||
bool | setModified = true | |||
) | [pure virtual] |
Sets the data of the input called <name>. If setModified is false then does not call bbSetModifiedStatus()
Referenced by bbCopyIOValues().
virtual void bbtk::BlackBox::bbBruteForceSetInputPointer | ( | const std::string & | name, | |
void * | data, | |||
bool | setModified = true | |||
) | [pure virtual] |
virtual void bbtk::BlackBox::bbSetOutput | ( | const std::string & | name, | |
Data | data | |||
) | [pure virtual] |
Sets the data of the output called <name>.
Referenced by bbCopyIOValues().
InputConnectorMapType& bbtk::BlackBox::bbGetInputConnectorMap | ( | ) | [inline] |
Returns the input connectors map.
Definition at line 162 of file bbtkBlackBox.h.
Referenced by bbAllocateConnectors(), bbConnectInput(), bbDesallocateConnectors(), bbDisconnectInput(), bbSetModifiedStatus(), bbUpdateInputs(), and bbUserOnShowWidget().
00163 { return mInputConnectorMap; }
OutputConnectorMapType& bbtk::BlackBox::bbGetOutputConnectorMap | ( | ) | [inline] |
Returns the output connectors map.
Definition at line 165 of file bbtkBlackBox.h.
Referenced by bbAllocateConnectors(), bbConnectOutput(), bbDesallocateConnectors(), bbDisconnectOutput(), and bbSignalOutputModification().
00166 { return mOutputConnectorMap; }
const InputConnectorMapType& bbtk::BlackBox::bbGetInputConnectorMap | ( | ) | const [inline] |
Returns the input connectors map (const).
Definition at line 168 of file bbtkBlackBox.h.
00169 { return mInputConnectorMap; }
const OutputConnectorMapType& bbtk::BlackBox::bbGetOutputConnectorMap | ( | ) | const [inline] |
Returns the output connectors map (const).
Definition at line 171 of file bbtkBlackBox.h.
00172 { return mOutputConnectorMap; }
void bbtk::BlackBox::bbGetHelp | ( | bool | full = true |
) | const [virtual] |
Prints the Help on the BlackBox type.
Definition at line 209 of file bbtkBlackBox.cxx.
References bbGetDescriptor().
00210 { 00211 bbGetDescriptor()->GetHelp(full); 00212 }
std::string bbtk::BlackBox::bbGetInputBoxProcessMode | ( | ) | [inline] |
Returns the value of the input "BoxProcessMode".
Definition at line 182 of file bbtkBlackBox.h.
00182 { return bbmBoxProcessMode; }
void bbtk::BlackBox::bbSetInputBoxProcessMode | ( | std::string | a | ) | [inline] |
Sets the value of the input "BoxProcessMode".
Definition at line 184 of file bbtkBlackBox.h.
00184 { bbmBoxProcessMode = a; }
BlackBox::BoxProcessModeValue bbtk::BlackBox::bbGetBoxProcessModeValue | ( | ) | const |
Returns the "decoded" value of the input "BoxProcessMode".
Definition at line 397 of file bbtkBlackBox.cxx.
References Always, bbGetFullName(), bbmBoxProcessMode, bbtkError, Pipeline, and Reactive.
Referenced by bbBoxProcessModeIsAlways(), and bbBoxProcessModeIsReactive().
00398 { 00399 const std::string& p = bbmBoxProcessMode; 00400 if ( (p == "0") || 00401 (p == "P") || (p == "p") || 00402 (p == "Pipeline") || (p == "pipeline") ) return Pipeline; 00403 if ( (p == "1") || 00404 (p == "A") || (p == "a") || 00405 (p == "Always") || (p == "always") ) return Always; 00406 if ( (p == "2") || 00407 (p == "R") || (p == "r") || 00408 (p == "Reactive") || (p == "reactive") ) return Reactive; 00409 bbtkError(bbGetFullName()<<" : BoxProcessMode value '"<<p 00410 <<"' unknown. Possible values : " 00411 <<"'0'/'P'/'p'/'Pipeline'/'pipeline' | " 00412 <<"'1'/'A'/'a'/'Always'/'always' | " 00413 <<"'2'/'R'/'r'/'Reactive'/'reactive'"<<std::endl); 00414 }
bool bbtk::BlackBox::bbBoxProcessModeIsReactive | ( | ) | const [virtual] |
Definition at line 418 of file bbtkBlackBox.cxx.
References bbGetBoxProcessModeValue(), and Reactive.
Referenced by bbSetModifiedStatus().
00419 { 00420 return (bbGetBoxProcessModeValue() == Reactive); 00421 }
bool bbtk::BlackBox::bbBoxProcessModeIsAlways | ( | ) | const [virtual] |
Definition at line 425 of file bbtkBlackBox.cxx.
References Always, and bbGetBoxProcessModeValue().
00426 { 00427 return (bbGetBoxProcessModeValue() == Always); 00428 }
Void bbtk::BlackBox::bbGetInputBoxExecute | ( | ) | [inline] |
void bbtk::BlackBox::bbSetInputBoxExecute | ( | Void | = 0 |
) | [inline] |
Void bbtk::BlackBox::bbGetOutputBoxChange | ( | ) | [inline] |
void bbtk::BlackBox::bbSetOutputBoxChange | ( | Void | = 0 |
) | [inline] |
Sets the value of the output "Change" : signal a modification.
Definition at line 207 of file bbtkBlackBox.h.
00207 { bbSetModifiedStatus(); }
void bbtk::BlackBox::bbInsertHTMLGraph | ( | std::ofstream & | s, | |
int | detail, | |||
int | level, | |||
bool | instanceOrtype, | |||
const std::string & | output_dir, | |||
bool | relative_link | |||
) | [inline] |
void bbtk::BlackBox::bbWriteDotFileBlackBox | ( | FILE * | ff, | |
BlackBox::Pointer | parentblackbox, | |||
int | detail, | |||
int | level, | |||
bool | instanceOrtype, | |||
bool | relative_link | |||
) | [virtual] |
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
Definition at line 892 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), bbGetInputAsString(), bbGetName(), bbGetOutputAsString(), bbGetTypeName(), bbWriteDotInputOutputName(), bbtk::Connection::GetOriginalBlackBoxFrom(), bbtk::Connection::GetOriginalBlackBoxFromOutput(), bbtk::Connection::GetOriginalBlackBoxTo(), bbtk::Connection::GetOriginalBlackBoxToInput(), bbtk::i, mInputConnectorMap, mOutputConnectorMap, and bbtk::SubsBrackets().
00898 { 00899 InputConnectorMapType::iterator i; 00900 // label 00901 std::string labelStr; 00902 std::string valueStr(""); 00903 00904 if (detail==0) { 00905 labelStr = bbGetName() ; 00906 //EED 18 Fev 2008 00907 labelStr = labelStr + "\\n[" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "]"; 00908 } else { 00909 labelStr = bbGetName(); 00910 labelStr = labelStr + " [" +this->bbGetDescriptor()->GetPackage()->GetName()+"::"+ bbGetTypeName() + "] "; 00911 } 00912 00913 SubsBrackets(labelStr); 00914 if (detail==1) 00915 { 00916 labelStr = labelStr + " | {{ "; 00917 std::string tempStrTypeName; 00918 bool tmp; 00919 tmp=false; 00920 for ( i = mInputConnectorMap.begin(); i != mInputConnectorMap.end(); ++i ) 00921 { 00922 if (tmp==true) 00923 { 00924 labelStr=labelStr+" | "; 00925 } 00926 tmp=true; 00927 if (instanceOrtype==true) 00928 { 00929 valueStr = this->bbGetInputAsString(i->first) + " = "; 00930 } 00931 const BlackBoxInputDescriptor* id = bbGetDescriptor()->GetInputDescriptor(i->first); 00932 tempStrTypeName=id->GetTypeName(); 00933 SubsBrackets(tempStrTypeName); 00934 std::string Name(i->first); 00935 SubsBrackets(Name); 00936 labelStr=labelStr + "<"+i->first.c_str()+"> " + valueStr + Name.c_str() + " [" + tempStrTypeName.c_str() + "]"; 00937 } 00938 labelStr=labelStr+ " } | {"; 00939 tmp = false; 00940 OutputConnectorMapType::iterator ii; 00941 for ( ii = mOutputConnectorMap.begin(); ii != mOutputConnectorMap.end(); ++ii ) 00942 { 00943 if (tmp==true) 00944 { 00945 labelStr=labelStr+" | "; 00946 } 00947 tmp = true; 00948 if (instanceOrtype==true) 00949 { 00950 valueStr = this->bbGetOutputAsString(ii->first) + " = "; 00951 } 00952 const BlackBoxOutputDescriptor* id = bbGetDescriptor()->GetOutputDescriptor(ii->first); 00953 tempStrTypeName=id->GetTypeName(); 00954 SubsBrackets(tempStrTypeName); 00955 std::string Name(ii->first); 00956 SubsBrackets(Name); 00957 labelStr=labelStr+"<"+ii->first.c_str()+"> " + valueStr + Name.c_str() + " ["+tempStrTypeName+"]"; 00958 } 00959 labelStr = labelStr+ " } }" ; 00960 } // detail 00961 00962 fprintf(ff," " ); 00963 bbWriteDotInputOutputName(ff,true,detail,level); 00964 std::string tmp ( bbGetTypeName() ); 00965 SubsBrackets(tmp); 00966 std::string url; 00967 if (relative_link) 00968 url = this->bbGetDescriptor()->GetPackage()->GetDocRelativeURL() + "#" + tmp; 00969 else 00970 url = this->bbGetDescriptor()->GetPackage()->GetDocURL() + "#" + tmp; 00971 00972 fprintf( ff , " [shape=record, URL=\"%s\",label=\"%s\"]%s\n",url.c_str(),labelStr.c_str(),";" ); 00973 // std::cout << labelStr << std::endl; 00974 00975 // Relation Input 00976 if (GetThisPointer<BlackBox>()!=parentblackbox){ 00977 for ( i = mInputConnectorMap.begin(); i != mInputConnectorMap.end(); ++i ) 00978 { 00979 if (i->second) 00980 { 00981 Connection* con = i->second->GetConnection(); 00982 if (con!=NULL){ 00983 BlackBox::Pointer a=con->GetOriginalBlackBoxFrom(); 00984 BlackBox::Pointer b=con->GetOriginalBlackBoxTo(); 00985 fprintf(ff," "); 00986 a->bbWriteDotInputOutputName(ff,false,detail,level); 00987 if (detail==1) 00988 { 00989 fprintf(ff,":%s",con->GetOriginalBlackBoxFromOutput().c_str()); 00990 } 00991 fprintf(ff,"->"); 00992 b->bbWriteDotInputOutputName(ff,true,detail,level); 00993 if (detail==1) 00994 { 00995 fprintf(ff,":%s",con->GetOriginalBlackBoxToInput().c_str()); 00996 } 00997 fprintf(ff,"%s\n",";"); 00998 } // if con 00999 } // if second 01000 } // for 01001 } // if parentblackbox 01002 }
void bbtk::BlackBox::bbWriteDotInputOutputName | ( | FILE * | ff, | |
bool | inputoutput, | |||
int | detail, | |||
int | level | |||
) | [virtual] |
Auxiliary method for bbWriteDotFileBlackBox.
Virtual.
Definition at line 753 of file bbtkBlackBox.cxx.
References bbGetTypeName().
Referenced by bbWriteDotFileBlackBox().
00754 { 00755 fprintf(ff,"%s%p",bbGetTypeName().c_str(),this); 00756 }
void bbtk::BlackBox::bbShowRelations | ( | BlackBox::Pointer | parentblackbox, | |
int | detail, | |||
int | level | |||
) | [virtual] |
Definition at line 1009 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), bbGetInputAsString(), bbGetName(), bbGetOutputAsString(), bbtkMessage, bbtk::Connection::GetOriginalBlackBoxFrom(), bbtk::Connection::GetOriginalBlackBoxFromOutput(), bbtk::i, mInputConnectorMap, and mOutputConnectorMap.
01012 { 01013 01014 if (this->bbGetDescriptor()->GetPackage()) 01015 { 01016 bbtkMessage("Help",1,"Black Box '"<<bbGetName()<<"' <"<< 01017 this->bbGetDescriptor()->GetPackage()->GetName() 01018 <<"::"<<this->bbGetDescriptor()->GetTypeName()<<">"<<std::endl); 01019 } 01020 else 01021 { 01022 bbtkMessage("Help",1,"Black Box <::"<<this->bbGetDescriptor()->GetTypeName()<<">"<<std::endl); 01023 } 01024 // bbtkMessage("Help",1," "<<GetDescription()<<std::endl); 01025 // bbtkMessage("Help",1," By : "<<GetAuthor()<<std::endl); 01026 01027 std::vector<std::string> iname; 01028 std::vector<std::string> ivalue; 01029 std::vector<std::string> iconn; 01030 01031 InputConnectorMapType::iterator i; 01032 unsigned int namelmax = 0; 01033 unsigned int valuelmax = 0; 01034 // unsigned int connlmax = 0; 01035 for ( i = mInputConnectorMap.begin(); i != mInputConnectorMap.end(); ++i ) 01036 { 01037 iname.push_back(i->first); 01038 if (iname.back().size()>namelmax) namelmax = iname.back().size(); 01039 ivalue.push_back(bbGetInputAsString(i->first)); 01040 if (ivalue.back().size()>valuelmax) valuelmax = ivalue.back().size(); 01041 std::string s(""); 01042 Connection* con = i->second->GetConnection(); 01043 if (con!=0){ 01044 s = con->GetOriginalBlackBoxFrom()->bbGetName(); 01045 s += "."; 01046 s += con->GetOriginalBlackBoxFromOutput(); 01047 } // if con 01048 iconn.push_back(s); 01049 } 01050 OutputConnectorMapType::iterator o; 01051 std::vector<std::string> oname; 01052 std::vector<std::string> ovalue; 01053 std::vector<std::vector<std::string> > oconn; 01054 for ( o = mOutputConnectorMap.begin(); o != mOutputConnectorMap.end(); ++o ) 01055 { 01056 oname.push_back(o->first); 01057 if (oname.back().size()>namelmax) namelmax = oname.back().size(); 01058 ovalue.push_back(bbGetOutputAsString(o->first)); 01059 if (ovalue.back().size()>valuelmax) valuelmax = ovalue.back().size(); 01060 std::vector<std::string> ss; 01061 const std::vector<Connection*>& con 01062 = o->second->GetConnectionVector(); 01063 std::vector<Connection*>::const_iterator c; 01064 for (c=con.begin();c!=con.end();++c) 01065 { 01066 std::string s; 01067 s = (*c)->GetOriginalBlackBoxTo()->bbGetName(); 01068 s += "."; 01069 s += (*c)->GetOriginalBlackBoxToInput(); 01070 ss.push_back(s); 01071 } // if con 01072 oconn.push_back(ss); 01073 } 01074 01075 if (iname.size()) 01076 bbtkMessage("Help",1," * Inputs : "<<std::endl); 01077 else 01078 bbtkMessage("Help",1," * No inputs"<<std::endl); 01079 01080 std::vector<std::string>::iterator i1,i2,i3; 01081 for (i1=iname.begin(),i2=ivalue.begin(),i3=iconn.begin(); 01082 i1!=iname.end(),i2!=ivalue.end(),i3!=iconn.end(); 01083 ++i1,++i2,++i3) 01084 { 01085 std::string name(*i1); 01086 name += "'"; 01087 name.append(1+namelmax-name.size(),' '); 01088 std::string value(*i2); 01089 value += "'"; 01090 value.append(1+valuelmax-value.size(),' '); 01091 if (i3->size()) 01092 bbtkMessage("Help",1," '"<<name<<" = '"<<value<<" <-- '"<<*i3<<"'"<<std::endl); 01093 else 01094 bbtkMessage("Help",1," '"<<name<<" = '"<<value<<std::endl); 01095 } 01096 01097 if (oname.size()) 01098 bbtkMessage("Help",1," * Outputs : "<<std::endl); 01099 else 01100 bbtkMessage("Help",1," * No outputs"<<std::endl); 01101 01102 std::vector<std::vector<std::string> >::iterator i4; 01103 01104 for (i1=oname.begin(),i2=ovalue.begin(),i4=oconn.begin(); 01105 i1!=oname.end(),i2!=ovalue.end(),i4!=oconn.end(); 01106 ++i1,++i2,++i4) 01107 { 01108 std::string name(*i1); 01109 name += "'"; 01110 name.append(1+namelmax-name.size(),' '); 01111 std::string value(*i2); 01112 value += "'"; 01113 value.append(1+valuelmax-value.size(),' '); 01114 if (!(*i4).size()) 01115 bbtkMessage("Help",1," '"<<name<<" = '"<<value<<std::endl); 01116 else 01117 { 01118 std::string pref = " '"+name+" = '"+value; 01119 for (i3=i4->begin();i3!=i4->end();++i3) 01120 { 01121 bbtkMessage("Help",1,pref<<" --> '"<<*i3<<"'"<<std::endl); 01122 pref.replace(0,pref.size(),pref.size(),' '); 01123 } 01124 } 01125 } 01126 01127 }
std::string bbtk::BlackBox::bbGetOutputAsString | ( | const std::string & | output | ) |
Definition at line 761 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), bbGetOutput(), and bbGetOutputType().
Referenced by bbShowRelations(), and bbWriteDotFileBlackBox().
00762 { 00763 std::string v; 00764 // Looks for the adaptor 00765 if (bbGetOutputType(output).name() != typeid(std::string).name() ) 00766 { 00767 // Look for factory 00768 Package::Pointer p = bbGetDescriptor()->GetPackage(); 00769 if ((p != 0) && ( ! p->GetFactorySet().empty() ) ) 00770 { 00771 Factory::Pointer f = p->GetFactorySet().begin()->lock(); 00772 BlackBox::Pointer a; 00773 try 00774 { 00775 a = f->NewAdaptor( 00776 bbGetOutputType(output), 00777 typeid(std::string), 00778 ""); 00779 } catch (bbtk::Exception e) 00780 { 00781 } 00782 if (a){ 00783 // bbUpdate(); 00784 a->bbSetInput("In",bbGetOutput(output)); 00785 a->bbExecute(); 00786 v = a->bbGetOutput("Out").unsafe_get<std::string>() ; 00787 } else { 00788 v="? (no adaptor found)"; 00789 } 00790 } 00791 else 00792 { 00793 v="? (no factory found)"; 00794 } 00795 } 00796 else 00797 { 00798 // bbUpdate(); 00799 v = bbGetOutput(output).unsafe_get<std::string>() ; 00800 } 00801 return v; 00802 }
std::string bbtk::BlackBox::bbGetInputAsString | ( | const std::string & | input | ) |
Definition at line 806 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), bbGetInput(), and bbGetInputType().
Referenced by bbShowRelations(), and bbWriteDotFileBlackBox().
00807 { 00808 std::string v; 00809 // Looks for the adaptor 00810 if (bbGetInputType(input) != typeid(std::string)) 00811 { 00812 // Look for factory 00813 Package::Pointer p = bbGetDescriptor()->GetPackage(); 00814 if ((p != 0) && ( ! p->GetFactorySet().empty() ) ) 00815 { 00816 Factory::Pointer f = p->GetFactorySet().begin()->lock(); 00817 BlackBox::Pointer a; 00818 try 00819 { 00820 a = f->NewAdaptor( 00821 bbGetInputType(input), 00822 typeid(std::string), 00823 ""); 00824 }catch (bbtk::Exception e) 00825 { 00826 } 00827 if (a) 00828 { 00829 // bbUpdate(); 00830 a->bbSetInput("In",bbGetInput(input)); 00831 a->bbExecute(); 00832 v = a->bbGetOutput("Out").unsafe_get<std::string>() ; 00833 } 00834 else 00835 { 00836 v="? (no adaptor found)"; 00837 } 00838 } 00839 else 00840 { 00841 v="? (no factory found)"; 00842 } 00843 } 00844 else 00845 { 00846 v = bbGetInput(input).unsafe_get<std::string>() ; 00847 } 00848 return v; 00849 }
virtual BlackBox::Pointer bbtk::BlackBox::bbFindBlackBox | ( | const std::string & | blackboxname | ) | [inline, virtual] |
void bbtk::BlackBox::Check | ( | bool | recursive = true |
) | [virtual] |
Definition at line 1186 of file bbtkBlackBox.cxx.
References bbGetFullName(), and bbtkMessage.
01187 { 01188 bbtkMessage("debug",1,"*** Checking Black Box "<<(void*)this<<" ["<<bbGetFullName() 01189 <<"] ... OK"<<std::endl); 01190 }
virtual void bbtk::BlackBox::bbUserOnShow | ( | ) | [inline, virtual] |
void bbtk::BlackBox::bbUserOnShowWidget | ( | std::string | nameInput | ) |
Definition at line 1193 of file bbtkBlackBox.cxx.
References bbGetInputConnectorMap().
01194 { 01195 bbtk::BlackBoxInputConnector *cc; 01196 cc = this->bbGetInputConnectorMap().find( nameInput.c_str() )->second; 01197 if (cc->GetConnection()!=NULL) 01198 { 01199 cc->GetConnection()->GetBlackBoxFrom()->bbUserOnShow(); 01200 } 01201 }
void bbtk::BlackBox::bbSetStatus | ( | IOStatus | t | ) | [inline, protected] |
Sets the status of the box.
Definition at line 270 of file bbtkBlackBox.h.
Referenced by bbSetModifiedStatus().
00270 { bbmStatus = t; }
void bbtk::BlackBox::bbSetParent | ( | BlackBox::Pointer | p | ) | [inline, private] |
Sets the parent of the BlackBox.
Definition at line 278 of file bbtkBlackBox.h.
00278 { bbmParent = p; }
void bbtk::BlackBox::bbConnectInput | ( | const std::string & | name, | |
Connection * | c | |||
) | [private, virtual] |
Connects the input <name> to the connection c.
Definition at line 632 of file bbtkBlackBox.cxx.
References bbGetFullName(), bbGetInputConnectorMap(), bbtkDebugMessage, bbtkError, bbtk::Connection::GetFullName(), and bbtk::i.
00633 { 00634 bbtkDebugMessage("connection",2, 00635 "==> BlackBox::bbConnectInput(\"" 00636 <<name<<"\","<<c->GetFullName()<<") [" 00637 <<bbGetFullName()<<"]" 00638 <<std::endl); 00639 00640 00641 InputConnectorMapType::iterator i = bbGetInputConnectorMap().find(name); 00642 if (i==bbGetInputConnectorMap().end()) 00643 { 00644 bbtkError("no input called '"<<name<<"'"); 00645 } 00646 i->second->SetConnection(c); 00647 00648 bbtkDebugMessage("connection",2, 00649 "<== BlackBox::bbConnectInput(\"" 00650 <<name<<"\","<<c->GetFullName()<<") [" 00651 <<bbGetFullName()<<"]" 00652 <<std::endl); 00653 // bbSetModifiedStatus(); 00654 00655 }
void bbtk::BlackBox::bbConnectOutput | ( | const std::string & | name, | |
Connection * | c | |||
) | [private, virtual] |
Connects the output <name> to the connection c.
Definition at line 661 of file bbtkBlackBox.cxx.
References bbGetFullName(), bbGetOutputConnectorMap(), bbtkDebugMessage, bbtkError, bbtk::Connection::GetFullName(), and bbtk::i.
00662 { 00663 bbtkDebugMessage("connection",2, 00664 "==> BlackBox::bbConnectOutput(\""<<name<<"\"," 00665 <<c->GetFullName()<<") [" 00666 <<bbGetFullName()<<"]"<<std::endl); 00667 00668 OutputConnectorMapType::iterator i = bbGetOutputConnectorMap().find(name); 00669 if (i==bbGetOutputConnectorMap().end()) 00670 { 00671 bbtkError("no output called '"<<name<<"'"); 00672 } 00673 i->second->SetConnection(c); 00674 00675 bbtkDebugMessage("connection",2, 00676 "<== BlackBox::bbConnectOutput(\""<<name<<"\"," 00677 <<c->GetFullName()<<") [" 00678 <<bbGetFullName()<<"]"<<std::endl); 00679 00680 }
void bbtk::BlackBox::bbDisconnectInput | ( | const std::string & | name, | |
Connection * | c | |||
) | [private, virtual] |
Disconnects the input <name> from the connection c.
Definition at line 686 of file bbtkBlackBox.cxx.
References bbGetFullName(), bbGetInputConnectorMap(), bbtkDebugMessage, bbtkError, bbtk::Connection::GetFullName(), and bbtk::i.
00687 { 00688 00689 bbtkDebugMessage("connection",2, 00690 "==> BlackBox::bbDisconnectInput(\""<<name 00691 <<"\","<<c->GetFullName()<<") [" 00692 <<bbGetFullName()<<"]" 00693 <<std::endl); 00694 00695 if (!c) 00696 { 00697 00698 bbtkDebugMessage("connection",2,"c==0"<<std::endl); 00699 return; 00700 } 00701 00702 InputConnectorMapType::iterator i = bbGetInputConnectorMap().find(name); 00703 if (i==bbGetInputConnectorMap().end()) 00704 { 00705 bbtkError("no input called '"<<name<<"'"); 00706 } 00707 i->second->UnsetConnection(c); 00708 00709 bbtkDebugMessage("connection",2, 00710 "<== BlackBox::bbDisconnectInput(\""<<name 00711 <<"\","<<c->GetFullName()<<") [" 00712 <<bbGetFullName()<<"]" 00713 <<std::endl); 00714 00715 }
void bbtk::BlackBox::bbDisconnectOutput | ( | const std::string & | name, | |
Connection * | c | |||
) | [private, virtual] |
Disconnects the output <name> from the connection c.
Definition at line 721 of file bbtkBlackBox.cxx.
References bbGetFullName(), bbGetOutputConnectorMap(), bbtkDebugMessage, bbtkError, bbtk::Connection::GetFullName(), and bbtk::i.
00722 { 00723 bbtkDebugMessage("connection",2, 00724 "==> BlackBox::bbDisconnectOutput(\""<<name 00725 <<"\","<<c->GetFullName()<<") [" 00726 <<bbGetFullName()<<"]" 00727 <<std::endl); 00728 if (!c) 00729 { 00730 00731 bbtkDebugMessage("connection",2,"c==0"<<std::endl); 00732 return; 00733 } 00734 00735 OutputConnectorMapType::iterator i = bbGetOutputConnectorMap().find(name); 00736 if (i==bbGetOutputConnectorMap().end()) 00737 { 00738 bbtkError("no output called '"<<name<<"'"); 00739 } 00740 i->second->UnsetConnection(c); 00741 00742 bbtkDebugMessage("connection",2, 00743 "<== BlackBox::bbDisconnectOutput(\""<<name 00744 <<"\","<<c->GetFullName()<<") [" 00745 <<bbGetFullName()<<"]" 00746 <<std::endl); 00747 }
virtual IOStatus bbtk::BlackBox::bbBackwardUpdate | ( | Connection::Pointer | caller | ) | [protected, pure virtual] |
Recursive pipeline processing in backward direction (recursion is in backward direction however execution always goes forward). Pure virtual; defined in UserBlackBox and ComplexBlackBox
caller | : The connection which invoked the method; null if called by bbExecute |
Referenced by bbExecute().
IOStatus bbtk::BlackBox::bbUpdateInputs | ( | bool | excludeParent = false |
) | [protected] |
Recursive pipeline processing in forward direction along "Child"-"Parent" connections Pure virtual; defined in UserBlackBox and ComplexBlackBox
caller | : The connection which invoked the method |
Updates the BlackBox inputs
Definition at line 595 of file bbtkBlackBox.cxx.
References bbGetFullName(), bbGetInputConnectorMap(), bbtkDebugMessageDec, bbtkDebugMessageInc, bbtk::i, bbtk::MODIFIED, and bbtk::UPTODATE.
00596 { 00597 bbtkDebugMessageInc("process",4, 00598 "=> BlackBox::bbUpdateInputs() [" 00599 <<bbGetFullName()<<"]" 00600 <<std::endl); 00601 00602 IOStatus s = UPTODATE; 00603 00604 InputConnectorMapType::iterator i; 00605 for ( i = bbGetInputConnectorMap().begin(); 00606 i!= bbGetInputConnectorMap().end(); ++i) 00607 { 00608 if (excludeParent && (i->first=="WinParent")) continue; 00609 if (i->first=="WinHide") continue; 00610 // If input type is Void : no recurse 00611 //if ( bbGetDescriptor()->GetInputDescriptor(i->first)->GetTypeInfo() 00612 // == typeid(Void) ) 00613 // continue; 00614 00615 IOStatus t = i->second->BackwardUpdate(); 00616 if (t==MODIFIED) s = MODIFIED; 00617 } 00618 00619 bbtkDebugMessageDec("process",4, 00620 "<= BlackBox::bbUpdateInputs() [" 00621 <<bbGetFullName()<<"]" 00622 <<std::endl); 00623 00624 00625 return s; 00626 }
virtual void bbtk::BlackBox::bbShowWindow | ( | Connection::Pointer | caller | ) | [inline, protected, virtual] |
Updates the pipeline in upstream-downstream direction along the "Child"-"Parent" connections only. Does nothing here. Overloaded in WxContainerBlackbox Specific methods for window creation during pipeline execution Creates the window associated to the box (called after bbUpdateInputs) Does nothing here. Overloaded in WxBlackBox. Shows the window associated to the box (called after bbProcess during bbExecute) Does nothing here but overloaded in WxBlackBox and WxContainerBlackBox
Definition at line 357 of file bbtkBlackBox.h.
virtual void bbtk::BlackBox::bbHideWindow | ( | ) | [inline, protected, virtual] |
Definition at line 359 of file bbtkBlackBox.h.
Referenced by bbSetModifiedStatus().
virtual void bbtk::BlackBox::bbCloseWindow | ( | ) | [inline, protected, virtual] |
bool bbtk::BlackBox::bbGlobalGetSomeBoxExecuting | ( | ) | [static] |
Definition at line 1157 of file bbtkBlackBox.cxx.
References bbtk::bbmgSomeBoxExecuting.
Referenced by bbCanReact().
01158 { 01159 return bbmgSomeBoxExecuting; 01160 }
void bbtk::BlackBox::bbGlobalSetSomeBoxExecuting | ( | bool | b | ) | [static] |
Definition at line 1162 of file bbtkBlackBox.cxx.
References bbtk::bbmgSomeBoxExecuting.
01163 { 01164 bbmgSomeBoxExecuting = b; 01165 }
void bbtk::BlackBox::bbGlobalSetFreezeExecution | ( | bool | b | ) | [static] |
Definition at line 1167 of file bbtkBlackBox.cxx.
References bbtk::bbmgFreezeExecution.
01168 { 01169 bbmgFreezeExecution = b; 01170 }
bool bbtk::BlackBox::bbGlobalGetFreezeExecution | ( | ) | [static] |
Definition at line 1172 of file bbtkBlackBox.cxx.
References bbtk::bbmgFreezeExecution.
Referenced by bbExecute().
01173 { 01174 return bbmgFreezeExecution; 01175 }
bool bbtk::BlackBox::bbCanReact | ( | ) | const [virtual] |
Returns true if the box can "react", which means execute in response to an input change
Definition at line 370 of file bbtkBlackBox.cxx.
References bbGlobalGetSomeBoxExecuting().
Referenced by bbSetModifiedStatus().
00371 { 00372 return ( bbGlobalGetSomeBoxExecuting() 00373 #ifdef _USE_WXWIDGETS_ 00374 || Wx::IsSomeWindowAlive() 00375 #endif 00376 ); 00377 }
void bbtk::BlackBox::bbGlobalAddToExecutionList | ( | BlackBox::Pointer | b | ) | [static, protected] |
Definition at line 1177 of file bbtkBlackBox.cxx.
References bbtk::bbmgExecutionList.
Referenced by bbSetModifiedStatus().
01178 { 01179 bbmgExecutionList.insert(b); 01180 }
void bbtk::BlackBox::bbGlobalProcessExecutionList | ( | ) | [static, protected] |
Definition at line 1132 of file bbtkBlackBox.cxx.
References bbtk::bbmgExecutionList, bbtkDebugMessage, bbtkDebugMessageDec, bbtkDebugMessageInc, and bbtk::i.
Referenced by bbSignalOutputModification().
01133 { 01134 bbtkDebugMessageInc("process",3, 01135 "=> BlackBox::bbGlobalProcessExecutionList()" 01136 <<std::endl); 01137 01138 std::set<BlackBox::Pointer>::iterator i; 01139 for (i=bbmgExecutionList.begin(); 01140 i!=bbmgExecutionList.end(); 01141 ++i) 01142 { 01143 bbtkDebugMessage("process",4, 01144 " -> Executing "<<(*i)->bbGetFullName()<<std::endl); 01145 (*i)->bbExecute(true); 01146 } 01147 01148 bbmgExecutionList.clear(); 01149 bbtkDebugMessageDec("process",3, 01150 "<= BlackBox::bbGlobalProcessExecutionList()" 01151 <<std::endl); 01152 01153 01154 }
void bbtk::BlackBox::bbAllocateConnectors | ( | ) | [protected, virtual] |
Allocates the i/o connectors of the black box.
Definition at line 275 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), bbGetFullName(), bbGetInputConnectorMap(), bbGetOutputConnectorMap(), bbtkDebugDecTab, bbtkDebugMessage, bbtkDebugMessageInc, and bbtk::i.
00276 { 00277 bbtkDebugMessageInc("Kernel",8, 00278 "BlackBox::bbAllocateConnectors() [" 00279 <<bbGetFullName()<<"]" 00280 <<std::endl); 00281 const BlackBoxDescriptor::InputDescriptorMapType& imap 00282 = bbGetDescriptor()->GetInputDescriptorMap(); 00283 BlackBoxDescriptor::InputDescriptorMapType::const_iterator i; 00284 for ( i = imap.begin(); i != imap.end(); ++i ) 00285 { 00286 bbtkDebugMessage("Kernel",8,"* Allocate \""<<i->first<<"\""<<std::endl); 00287 bbGetInputConnectorMap()[i->second->GetName()] 00288 = new BlackBoxInputConnector(GetThisPointer<BlackBox>()); 00289 } 00290 const BlackBoxDescriptor::OutputDescriptorMapType& omap 00291 = bbGetDescriptor()->GetOutputDescriptorMap(); 00292 BlackBoxDescriptor::OutputDescriptorMapType::const_iterator o; 00293 for ( o = omap.begin(); o != omap.end(); ++o ) 00294 { 00295 bbtkDebugMessage("Kernel",8,"* Allocate \""<<o->first<<"\""<<std::endl); 00296 bbGetOutputConnectorMap()[o->second->GetName()] 00297 = new BlackBoxOutputConnector(); 00298 } 00299 bbtkDebugDecTab("Kernel",8); 00300 }
void bbtk::BlackBox::bbDesallocateConnectors | ( | ) | [protected, virtual] |
Desallocates the i/o connectors of the black box.
Definition at line 306 of file bbtkBlackBox.cxx.
References bbGetInputConnectorMap(), bbGetOutputConnectorMap(), bbtkDebugDecTab, bbtkDebugMessage, bbtkDebugMessageInc, and bbtk::i.
Referenced by ~BlackBox().
00307 { 00308 bbtkDebugMessageInc("Kernel",8, 00309 "BlackBox::bbDesallocateConnectors()" 00310 <<std::endl); 00311 00312 InputConnectorMapType::const_iterator i; 00313 for ( i = bbGetInputConnectorMap().begin(); 00314 i != bbGetInputConnectorMap().end(); ++i ) 00315 { 00316 bbtkDebugMessage("Kernel",8,"* Delete \""<<i->first<<"\""<<std::endl); 00317 delete (i->second); 00318 } 00319 OutputConnectorMapType::const_iterator o; 00320 for ( o = bbGetOutputConnectorMap().begin(); 00321 o != bbGetOutputConnectorMap().end(); ++o ) 00322 { 00323 bbtkDebugMessage("Kernel",8,"* Delete \""<<o->first<<"\""<<std::endl); 00324 delete (o->second); 00325 } 00326 00327 bbtkDebugDecTab("Kernel",8); 00328 00329 }
void bbtk::BlackBox::bbCopyIOValues | ( | BlackBox & | from | ) | [protected, virtual] |
Copies the values of the inputs/output from the BlackBox from.
Copies the input / output values from another box.
Definition at line 335 of file bbtkBlackBox.cxx.
References bbGetDescriptor(), bbGetFullName(), bbGetInput(), bbGetOutput(), bbSetInput(), bbSetOutput(), bbtkDebugDecTab, bbtkDebugMessageInc, and bbtk::i.
00336 { 00337 bbtkDebugMessageInc("Kernel",9, 00338 "BlackBox::bbCopyIOValues(" 00339 <<from.bbGetFullName()<<") [" 00340 <<bbGetFullName()<<"]"<<std::endl); 00341 // copies the input values 00342 const BlackBoxDescriptor::InputDescriptorMapType& imap 00343 = bbGetDescriptor()->GetInputDescriptorMap(); 00344 BlackBoxDescriptor::InputDescriptorMapType::const_iterator i; 00345 for ( i = imap.begin(); i != imap.end(); ++i ) 00346 { 00347 if (! i->second->GetCopyConstruct() ) continue; 00348 std::string input = i->second->GetName(); 00349 this->bbSetInput(input, from.bbGetInput(input) ); 00350 } 00351 // copies the output values 00352 const BlackBoxDescriptor::OutputDescriptorMapType& omap 00353 = bbGetDescriptor()->GetOutputDescriptorMap(); 00354 BlackBoxDescriptor::OutputDescriptorMapType::const_iterator o; 00355 for ( o = omap.begin(); o != omap.end(); ++o ) 00356 { 00357 if (! o->second->GetCopyConstruct() ) continue; 00358 std::string output = o->second->GetName(); 00359 this->bbSetOutput(output, from.bbGetOutput(output) ); 00360 } 00361 00362 bbtkDebugDecTab("Kernel",9); 00363 00364 }
static boost::shared_ptr<U> bbtk::BlackBox::MakeBlackBoxPointer | ( | U * | s, | |
bool | lock = false | |||
) | [inline, static, protected] |
Definition at line 405 of file bbtkBlackBox.h.
00406 { 00407 return MakePointer(s,BlackBox::Deleter(),lock); 00408 }
virtual void bbtk::BlackBox::bbDelete | ( | ) | [inline, protected, virtual] |
Definition at line 410 of file bbtkBlackBox.h.
Referenced by bbtk::BlackBox::Deleter::Delete().
std::string bbtk::Object::GetObjectName | ( | ) | const [virtual, inherited] |
Reimplemented in bbtk::Connection, bbtk::Executer, bbtk::Factory, bbtk::Interpreter, bbtk::Package, and bbtk::Transcriptor.
Definition at line 91 of file bbtkObject.cxx.
Referenced by bbtk::BlackBox::Deleter::Delete(), and bbtk::Object::Deleter::operator()().
std::string bbtk::Object::GetObjectInfo | ( | ) | const [virtual, inherited] |
Reimplemented in bbtk::Connection, bbtk::Executer, bbtk::Factory, bbtk::Interpreter, bbtk::Package, and bbtk::Transcriptor.
Definition at line 98 of file bbtkObject.cxx.
virtual size_t bbtk::Object::GetObjectSize | ( | ) | const [inline, virtual, inherited] |
Reimplemented in bbtk::Connection, bbtk::Executer, bbtk::Factory, bbtk::Interpreter, bbtk::Package, and bbtk::Transcriptor.
Definition at line 60 of file bbtkObject.h.
00060 { return sizeof(Object); }
virtual size_t bbtk::Object::GetObjectInternalSize | ( | ) | const [inline, virtual, inherited] |
Reimplemented in bbtk::Connection, bbtk::Executer, bbtk::Factory, bbtk::Interpreter, bbtk::Package, and bbtk::Transcriptor.
Definition at line 61 of file bbtkObject.h.
00061 { return sizeof(Object); }
virtual size_t bbtk::Object::GetObjectRecursiveSize | ( | ) | const [inline, virtual, inherited] |
Reimplemented in bbtk::Connection, bbtk::Executer, bbtk::Factory, bbtk::Interpreter, bbtk::Package, and bbtk::Transcriptor.
Definition at line 62 of file bbtkObject.h.
00062 { return sizeof(Object); }
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.
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::RemoveFromObjectList | ( | WeakPointer | p | ) | [static, inherited] |
Definition at line 80 of file bbtkObject.cxx.
References bbtkDebugMessage, and bbtk::Object::mgObjectList.
00081 { 00082 bbtkDebugMessage("object",9,"##> Object::RemoveFromObjectList()" 00083 <<std::endl); 00084 mgObjectList.erase(p); 00085 00086 }
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::ReleasePackages | ( | ) | [static, inherited] |
Definition at line 213 of file bbtkObject.cxx.
References bbtkDebugMessage, bbtk::i, and bbtk::Object::mgPackageList.
00214 { 00215 bbtkDebugMessage("object",1,"##> Object::ReleasePackages()"<<std::endl); 00216 // Release package pointers 00217 ObjectListType::iterator i; 00218 for (i = mgPackageList.begin(); 00219 i!= mgPackageList.end(); 00220 ++i) 00221 { 00222 if (i->use_count() != 0) 00223 { 00224 bbtkDebugMessage("object",1,"##> Releasing package '"<< 00225 i->lock()->GetThisPointer<Package>()->GetName() 00226 <<"'"<<std::endl); 00227 // Object::Pointer p(i->lock()); 00228 Package::WeakPointer w(i->lock()->GetThisPointer<Package>()); 00229 Package::Release(w); 00230 /* 00231 if (p->GetObjectName().find(name) != std::string::npos ) 00232 { 00233 std::cout << n << "/" << mgObjectList.size() << " "; 00234 PrintObjectInfo(p); 00235 m += p->GetObjectSize(); 00236 n++; 00237 } 00238 */ 00239 } 00240 } 00241 00242 }
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().
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. destroyed without removing itself from the living objects list ! (this is just an implementation error not a memory leak)"<<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. destroyed without removing themselves from the living objects list ! (this is just an implementation error not a memory leak)"<<std::endl; 00150 } 00151 std::cout 00152 << "============ EO Living bbtk::Object pointers ========="<<std::endl; 00153 00154 }
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 }
static long bbtk::Object::GetObjectsCount | ( | ) | [inline, static, inherited] |
void bbtk::Object::LockThis | ( | ) | [inline, protected, inherited] |
void bbtk::Object::UnLockThis | ( | ) | [inline, protected, inherited] |
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 }
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.
Referenced by bbtk::Executer::Executer(), bbtk::Interpreter::Init(), bbtk::Transcriptor::New(), bbtk::Package::New(), bbtk::Interpreter::New(), bbtk::Factory::New(), and bbtk::Executer::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 }
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.
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 }
friend struct Object::Deleter [friend] |
Definition at line 63 of file bbtkBlackBox.h.
friend class Connection [friend] |
Definition at line 274 of file bbtkBlackBox.h.
friend class ComplexBlackBox [friend] |
Definition at line 275 of file bbtkBlackBox.h.
IOStatus bbtk::BlackBox::bbmStatus [private] |
std::string bbtk::BlackBox::bbmName [private] |
The name of the black-box.
Definition at line 419 of file bbtkBlackBox.h.
Referenced by bbGetNameWithParent(), BlackBox(), and ~BlackBox().
std::string bbtk::BlackBox::bbmPackageName [private] |
std::string bbtk::BlackBox::bbmBoxProcessMode [private] |
0 : "Pipeline" mode : bbBackwardUpdate() only calls Process if Status == MODIFIED (normal pipeline processing) 1 : "Always" mode : bbUpdate() always calls Process 2 : "Reactive" mode : bbSetModifiedStatus() calls bbUpdate()
Definition at line 426 of file bbtkBlackBox.h.
Referenced by bbGetBoxProcessModeValue(), and BlackBox().
BlackBox::WeakPointer bbtk::BlackBox::bbmParent [private] |
The parent of the black box in the ComplexBlackBox hierarchy.
Definition at line 429 of file bbtkBlackBox.h.
Referenced by bbGetNameWithParent(), and BlackBox().
OutputConnectorMapType bbtk::BlackBox::mOutputConnectorMap [private] |
Map that contains the output connectors of the black box.
Definition at line 436 of file bbtkBlackBox.h.
Referenced by bbShowRelations(), and bbWriteDotFileBlackBox().
InputConnectorMapType bbtk::BlackBox::mInputConnectorMap [private] |
Map that contains the input connectors of the black box.
Definition at line 438 of file bbtkBlackBox.h.
Referenced by bbShowRelations(), and bbWriteDotFileBlackBox().