X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Fscd_in_connector.h;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Fscd_in_connector.h;h=46e3c10709dcfde34aaf979dde3732937246becf;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/hdsd/scd/scd_in_connector.h b/dol/src/dol/visitor/hdsd/scd/scd_in_connector.h new file mode 100644 index 0000000..46e3c10 --- /dev/null +++ b/dol/src/dol/visitor/hdsd/scd/scd_in_connector.h @@ -0,0 +1,46 @@ +#ifndef SCD_IN_CONNECTOR_H +#define SCD_IN_CONNECTOR_H + +#include "scd_socket.h" +#include "scd_sock_poller.h" +#include "scd_simulator.h" +#include "scd_command_reader.h" + +/** + * Reads a command from a socket handled over by scd_init_listener + * and dispatches the connection to either the control or channel manager. + * This is used during the initialization phase. + */ +class scd_in_connector : public scd_sock_ev_handler_if +{ +public: + /** + * Constructor. + * \param sim the simulator + * \param sock the socket of the connection to read the command from + */ + scd_in_connector(scd_simulator &sim, scd_socket* sock); + + ~scd_in_connector(); + + /** + * Indicates if this in_connector is still reading the incomming command. + * It can be deconstructed when this indicates false. + * \return true if this in_connector is still working + */ + bool is_connecting(); + + /* scd_sock_ev_handler_if */ + void handle_sock_ev(sock_ev events); + const scd_socket& get_sock(); + +private: + scd_socket* _socket; + scd_simulator &_sim; + bool _is_connecting; + scd_command_reader _reader; + + void _cleanup(); +}; + +#endif