1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System.Diagnostics;
|
---|
23 | using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts;
|
---|
24 | namespace HeuristicLab.Clients.Hive.SlaveCore {
|
---|
25 |
|
---|
26 | /// <summary>
|
---|
27 | /// Class for writing the client communication to Trace
|
---|
28 | /// </summary>
|
---|
29 | public class TraceCom : IClientCom {
|
---|
30 | private ISlaveCommunication clientCom;
|
---|
31 |
|
---|
32 | public TraceCom() {
|
---|
33 | clientCom = new TraceSlaveCommunication();
|
---|
34 | }
|
---|
35 |
|
---|
36 | public ISlaveCommunication GetSlaveCom() {
|
---|
37 | return clientCom;
|
---|
38 | }
|
---|
39 |
|
---|
40 | public void Close() {
|
---|
41 | // Nothing to do here ...
|
---|
42 | }
|
---|
43 |
|
---|
44 | #region Private Class
|
---|
45 | private class TraceSlaveCommunication : ISlaveCommunication {
|
---|
46 |
|
---|
47 | public TraceSlaveCommunication() {
|
---|
48 |
|
---|
49 | }
|
---|
50 |
|
---|
51 | public StatusCommons Subscribe() {
|
---|
52 | Trace.WriteLine("Subscribe");
|
---|
53 | return new StatusCommons();
|
---|
54 | }
|
---|
55 |
|
---|
56 | public bool Unsubscribe() {
|
---|
57 | Trace.WriteLine("Unsubscribe");
|
---|
58 | return false;
|
---|
59 | }
|
---|
60 |
|
---|
61 | public void Restart() {
|
---|
62 | Trace.WriteLine("Restart");
|
---|
63 | }
|
---|
64 |
|
---|
65 | public void Sleep() {
|
---|
66 | Trace.WriteLine("Sleep");
|
---|
67 | }
|
---|
68 |
|
---|
69 | public void PauseAll() {
|
---|
70 | Trace.WriteLine("PauseAll");
|
---|
71 | }
|
---|
72 |
|
---|
73 | public void StopAll() {
|
---|
74 | Trace.WriteLine("StopAll");
|
---|
75 | }
|
---|
76 |
|
---|
77 | public void AbortAll() {
|
---|
78 | Trace.WriteLine("AbortAll");
|
---|
79 | }
|
---|
80 |
|
---|
81 | public void LogMessage(string message) {
|
---|
82 | Trace.WriteLine(message);
|
---|
83 | }
|
---|
84 |
|
---|
85 | public void StatusChanged(StatusCommons status) {
|
---|
86 | Trace.WriteLine("StatusChanged: " + status);
|
---|
87 | }
|
---|
88 |
|
---|
89 | public void Shutdown() {
|
---|
90 | Trace.WriteLine("Shutdown");
|
---|
91 | }
|
---|
92 | }
|
---|
93 |
|
---|
94 | #endregion
|
---|
95 | }
|
---|
96 | } |
---|