/*********************************************************************/ /* */ /* AgentService Framework */ /* www.agentservice.it */ /* */ /* Copyright (C) 2007 l.i.d.o. - DIST, University of Genoa, Italy */ /* GNU Lesser General Public License */ /* */ /* This library is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU Lesser General Public */ /* License as published by the Free Software Foundation, */ /* version 2.1 of the License. */ /* */ /* This library 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 */ /* Lesser General Public License for more details. */ /* */ /* You should have received a copy of the GNU Lesser General Public */ /* License along with this library; if not, write to the */ /* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ /* Boston, MA 02111-1307, USA. */ /* */ /*********************************************************************/ using System; using System.ServiceModel; using System.IO; using System.Collections.Generic; using System.Text; namespace AgentService.Platform { /// /// Interface IConsole. Exposes all the consoles used by /// the platform. /// public interface IConsole { /// /// Gets the input console. The input console /// provides the same facilities as the standard /// input for console application. /// TextReader Input { get; } /// /// Gets the platform main console. The main console /// represents the main standard ouput of the platform. /// TextWriter Main { get; } /// /// Gets the platform error console. The error console /// represents the standard error output of the platform. /// TextWriter Error { get; } /// /// Gets the platform warning console. The warning console /// is used either by the platform or by all those software /// components wich have a reference to the platform controller /// to post warning messages. /// TextWriter Warning { get; } } /// /// Interface IPlatformConsole. Gives access to the console of the AgentService /// platform and offers the functionality to append messages to the console. /// public interface IAgentConsole { /// /// Appends a formatted message to the console /// /// string identifier of the entity who appends the message /// formatted message /// arguments used in the formatted message void AppendMessage(string source, string message, params object[] objects); /// /// Appends a message to the console /// /// string identifier of the entity who appends the message /// message appended to the console void AppendMessage(string source, string message); } /// /// Interface IPlatformConsole. Extends the IConsole and provides additional /// facility provided by the IAgentConsole interface. The console is /// extended with another field representing an additional console used /// by agents to post messages. IPlatformConsole provides shortcut methods to /// write to the three managed consoles. /// public interface IPlatformConsole : IConsole { IAgentConsole BlackBoard { get; } /// /// Writes a line to the platform's output console and formats it properly. /// /// message content void WriteLineMessage(string message); /// /// Writes a message to the platform's output console and formats it properly. /// /// message content void WriteMessage(string message); /// /// Appends a message to the current line of the platform's output console and /// moves to new line. /// /// message content void AppendMessage(string message); /// /// Writes an error to the ErrorConsole /// /// error description void WriteError(string message); /// /// Writes an error to the Error console. /// /// error description /// arguments void WriteError(string message, params object[] args); /// /// Writes a warning message to the Warning console. /// /// warning message void WriteWarning(string message); /// /// Writes a warning message to the Warning console. /// /// warning message /// arguments void WriteWarning(string message, params object[] args); } }