Find as many flows as you can in the following code. Please describe each of them in detail.
class AbstractHandle
{
public:
AbstractHandle()
{
connect();
}
~AbstractHandle()
{
disconnect();
}
protected:
virtual void connect()
{
}
virtual void disconnect()
{
}
};
class ConcreteHandle : public AbstractHandle
{
protected:
virtual void connect()
{
if (MyAPIConnect() != API_OPERATION_OK)
throw "Connection error.";
}
virtual void disconnect()
{
if (MyAPIDisconnect() != API_OPERATION_OK)
throw "Disconnection error";
}
};
Исправлена подсветка синтаксиса. -- ПК.