* \brief Class bbtk::GPortModel : abstract black-box interface.
*/
-/**
-* \class bbtk::GPortModel
-* \brief
-*/
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
#ifndef __GPortModel_h__
#define __GPortModel_h__
namespace bbtk
{
+ // Mandatory when exists a bidirectional relation: GPortModel includes GBoxModel and viceversa
class GBoxModel;
class GPortModel : public GObjectModel
GPortModel();
virtual ~GPortModel();
- //Public methods
+ //Public methods
+
+ // Register the input or output in a position of the black box, depending in the portType(INPUT/OUTPUT).
void registerInBox(GBoxModel *blackBox,int portType, int pos);
+
+ // Update the port position based in the parent box initial point
void updatePortPosition();
+
+ // Port type (INPUT/OUTPUT)
int getPortType();
+
GBoxModel* getParentBox();
- virtual std::string getStatusText();
+
+ // Returns the position of the port in the box
+ int getPosInBox();
+
bool isConnected();
void setConnected(bool value);
+
bool isValueSet();
void setValue(std::string value);
+
std::string getValue();
+
+ virtual std::string getStatusText();
virtual void save(std::string &content);
- int getPosInBox();
+
private:
- //Attributes
+ //Private Attributes
GBoxModel *_parentBox;
-
+
+ // Port type (INPUT/OUTPUT)
int _portType;
+
+ // The position of the port in the box
int _posInBox;
+
bool _isConnected;
+
std::string _value;
bool _isValueSet;