/* Blinker
   Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org>
   Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
   a blinkenarea.org project */

#ifndef BLINKER_OPREQIF_H
#define BLINKER_OPREQIF_H

#include <string>

#include "OpConnIf.h"

namespace Blinker {

class OpConn;

/// operator connection request interface
class OpReqIf: public OpConnIf
{
public:
  /// constructor
  OpReqIf();

  /// virtual destructor
  virtual ~OpReqIf();

public:
  /**
   * @brief check if accepting new operator connection is possible
   * @param[in] name operator interface name
   * @return if accepting new connection is possible
   */
  virtual bool acceptNewOpConn(const std::string &name) = 0;

  /**
   * @brief new operator connection
   * @param[in] name operator interface name
   * @param[in] pConn operator connection object
   *
   * The new connection may not yet be used for sending inside this callback.
   */
  virtual void newOpConn(const std::string &name, OpConn *pConn) = 0;
}; // class OpReqIf

} // namespace Blinker

#endif // #ifndef BLINKER_OPREQIF_H

