* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
-/**
-* \file
-* \brief Class bbtk::GBlackBox
-*/
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
+
#include "GBlackBoxModel.h"
namespace bbtk
content+="\n";
//Ports with a value
- for(int i = 0; i<_inputs.size();i++)
+ for(int i = 0; i<(int)_inputs.size();i++)
{
if(_inputs[i]->isValueSet())
{
void GBlackBoxModel::setValueToInput(std::string name,std::string value)
{
- for(int i = 0; i<_inputs.size();i++)
+ for(int i = 0; i<(int)_inputs.size();i++)
{
if(_inputs[i]->getBBTKName()==name)
{
//=========================================================================
-} // EO namespace bbtk
+ std::string GBlackBoxModel::getValueInputPort(int pos)
+ {
+ std::string text = _inputs[pos]->getValue();
+ return text;
+ }
+
+ //=========================================================================
+
+ std::string GBlackBoxModel::getValueInput(std::string name)
+ {
+ for(int i = 0; i<(int)_inputs.size();i++)
+ {
+ if(_inputs[i]->getBBTKName()==name)
+ {
+ return _inputs[i]->getValue();
+ }
+ }
+ return NULL;
+ }
+
+ //=========================================================================
+
+ std::vector<int> GBlackBoxModel::getConnectedInputs()
+ {
+ std::vector<int> connected;
+ for(int i = 0; i<(int)_inputs.size();i++)
+ {
+ if(_inputs[i]->isConnected())
+ {
+ connected.push_back(i);
+ }
+ }
+ return connected;
+ }
+
+ //=========================================================================
+
+ std::vector<int> GBlackBoxModel::getConnectedOutputs()
+ {
+ std::vector<int> connected;
+ for(int i = 0; i<(int)_outputs.size();i++)
+ {
+ if(_outputs[i]->isConnected())
+ {
+ connected.push_back(i);
+ }
+ }
+ return connected;
+ }
+
+ //=========================================================================
+} // EO namespace bbtk
// EOF