/*========================================================================= Program: bbtk Module: $RCSfile: bbtkAtomicBlackBox.cxx,v $ Language: C++ Date: $Date: 2008/04/18 12:59:14 $ Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ /** * \file * \brief class bbtk::AtomicBlackBox : abstract user defined black boxes */ #include "bbtkAtomicBlackBox.h" namespace bbtk { //========================================================================= AtomicBlackBox::AtomicBlackBox(const std::string &name, bool alloc) : BlackBox(name) { bbtkDebugMessage("object",3, "==> AtomicBlackBox::AtomicBlackBox(\"" <AtomicBlackBox::AtomicBlackBox(" < AtomicBlackBox::~AtomicBlackBox()" < AtomicBlackBox::bbBackwardUpdate(" <<(caller?caller->GetFullName():"0")<<") [" <GetOutputDescriptor(name))->GetGetFunctor()->Get(this); bbtkDebugDecTab("Data",7); return p; } //========================================================================= //========================================================================= /// Gets the input Data of a given name Data AtomicBlackBox::bbGetInput( const std::string &name ) { bbtkDebugMessageInc("Data",7, "AtomicBlackBox::bbGetInput(\""<GetInputDescriptor(name))->GetGetFunctor()->Get(this); bbtkDebugDecTab("Data",7); return p; } //========================================================================= //========================================================================= /// Sets the data of the output called void AtomicBlackBox::bbSetOutput( const std::string &name, Data data) { bbtkDebugMessageInc("Data",7, "AtomicBlackBox::bbSetOutput(\""<GetOutputDescriptor(name))->GetSetFunctor()->Set(this,data); bbtkDebugDecTab("Data",7); } //========================================================================= //========================================================================= /// Sets the data of the input called void AtomicBlackBox::bbSetInput( const std::string &name, Data data, bool setModified ) { bbtkDebugMessageInc("Data",7, "AtomicBlackBox::bbSetInput(\""<GetInputDescriptor(name))->GetSetFunctor()->Set(this,data); if (setModified) { bbSetModifiedStatus(); } bbtkDebugDecTab("Data",7); } //========================================================================= //========================================================================= /// Sets the data of the input called void AtomicBlackBox::bbBruteForceSetInputPointer ( const std::string &name, void* data, bool setModified ) { bbtkDebugMessageInc("Data",7, "AtomicBlackBox::bbBruteForceSetInputPointer(\"" <GetInputDescriptor(name))->GetSetFunctor() ->BruteForceSetPointer(this,data); if (setModified) { bbSetModifiedStatus(); } bbtkDebugDecTab("Data",7); } //========================================================================= //========================================================================== std::string AtomicBlackBox::GetObjectInfo() const { std::stringstream i; return i.str(); } //========================================================================== //========================================================================== size_t AtomicBlackBox::GetObjectSize() const { return sizeof(*this); } //========================================================================== //========================================================================== size_t AtomicBlackBox::GetObjectRecursiveSize() const { size_t s = GetObjectSize(); return s; } //========================================================================== } // EO namespace bbtk