C++ (Qt)class QFigure{ ... static QFigure* create(QByteArray *data){ ???????????????????????????????????? } virtual draw() = 0;}; class QEllipse : public QFigure{...}; class QSquare : public QFigure{...};
C++ (Qt)class QNetShapeCreator : QTcpSocket{public: QNetShapeCreator(){ connect(this, SIGNAL(readyRead()), this, SLOT(readyReadData())); } QDataArray *data; QList<QFigure*> figures; readyReadData(){ *data = readAll(); figures.append(QFigure::create(data)); }};