Program: bbtk
Module: $RCSfile: bbstdMagicBox.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:26 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2009/03/30 14:42:23 $
+ Version: $Revision: 1.6 $
=========================================================================*/
/* ---------------------------------------------------------------------
#include "bbstdMagicBox.h"
#include "bbstdPackage.h"
+#include "bbtkBlackBoxOutputConnector.h"
+using namespace bbtk;
+
namespace bbstd
{
+ void MagicBox::bbSetStatusAndPropagate(bbtk::BlackBoxInputConnector* c,
+ bbtk::IOStatus s)
+ {
+ bbtkDebugMessageInc("change",5,
+ "=> MagicBox::bbSetStatusAndPropagate(input,"
+ <<GetIOStatusString(s)<<") ["
+ <<bbGetFullName()<<"]"<<std::endl);
+ if (mCanSet)
+ {
+ if (c->IsConnected())
+ {
+ std::string do_input = c->GetConnection()->GetBlackBoxToInput();
+ c->GetConnection()->TransferData();
+ bbSetOutputOut( bbGetInput(do_input) );
+ }
+ mCanSet = false;
+ }
+ BlackBox::bbSetStatusAndPropagate(c,s);
+ }
+
+ void MagicBox::DoProcess()
+ {
+ mCanSet = true;
+ }
+
BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MagicBox);
BBTK_BLACK_BOX_IMPLEMENTATION(MagicBox,bbtk::AtomicBlackBox);