#region License Information
/* HeuristicLab
* Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
*
* This file is part of HeuristicLab.
*
* HeuristicLab is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* HeuristicLab is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with HeuristicLab. If not, see .
*/
#endregion
using Google.ProtocolBuffers;
using HeuristicLab.Core;
namespace HeuristicLab.Problems.ExternalEvaluation {
public interface IEvaluationChannel : IItem {
///
/// A flag that describes whether the channel has been initialized or not.
///
bool IsInitialized { get; }
///
/// Opens the channel for communication.
///
///
/// Must be called before calling or .
/// The concrete implementation of the channel may require additional information on how to start a connection,
/// which should be passed into the concrete channel's constructor.
///
void Open();
///
/// Sends a message over the channel.
///
/// The message to send.
void Send(IMessage solution);
///
/// Receives a message from the channel and merges the message with the given builder.
///
/// The builder that must match the message type that is to be received.
/// The received message.
IMessage Receive(IBuilder builder);
///
/// Tells the channel to close down and terminate open connections.
///
void Close();
}
}