blob: 0ecf04d436fc9a8bdd5fdf18d82e12d51983207d [file] [log] [blame]
[email protected]04ca1bc2009-05-08 23:00:291// Copyright (c) 2009 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef COURGETTE_ADJUSTMENT_METHOD_H_
6#define COURGETTE_ADJUSTMENT_METHOD_H_
7
8#include "base/basictypes.h"
9
10namespace courgette {
11
12class AssemblyProgram;
13
14class AdjustmentMethod {
15 public:
16 // Factory methods for making adjusters.
17
18 // Returns the adjustment method used in production.
[email protected]8cd96962009-06-03 23:28:1419 static AdjustmentMethod* MakeProductionAdjustmentMethod() {
20 return MakeShingleAdjustmentMethod();
21 }
[email protected]04ca1bc2009-05-08 23:00:2922
23 // Returns and adjustement method that makes no adjustments.
24 static AdjustmentMethod* MakeNullAdjustmentMethod();
25
[email protected]8cd96962009-06-03 23:28:1426 // Returns the original adjustment method.
27 static AdjustmentMethod* MakeTrieAdjustmentMethod();
28
29 // Returns the new shingle tiling adjustment method.
30 static AdjustmentMethod* MakeShingleAdjustmentMethod();
31
32 // AdjustmentMethod interface:
[email protected]04ca1bc2009-05-08 23:00:2933
34 // Adjusts |program| to increase similarity to |model|. |program| can be
35 // changed in any way provided that it still produces the same output when
36 // assembled.
37 virtual bool Adjust(const AssemblyProgram& model,
38 AssemblyProgram* program) = 0;
39
40 // Deletes 'this' adjustment method.
41 virtual void Destroy();
42
43 protected:
44 AdjustmentMethod() {}
45 virtual ~AdjustmentMethod() {}
46
47 DISALLOW_COPY_AND_ASSIGN(AdjustmentMethod);
48};
49
50} // namespace courgette
51#endif // COURGETTE_ADJUSTMENT_METHOD_H_