summaryrefslogtreecommitdiff
path: root/include/mcld/MC/InputAction.h
blob: 4b94378cdb189a1eada8e14ccc875298cb266bf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//===- InputAction.h ------------------------------------------------------===//
//
//                     The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_MC_INPUTACTION_H
#define MCLD_MC_INPUTACTION_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif

namespace mcld {

class SearchDirs;
class InputBuilder;

//===----------------------------------------------------------------------===//
// Base InputAction
//===----------------------------------------------------------------------===//
/** \class InputAction
 *  \brief InputAction is a command object to construct mcld::InputTree.
 */
class InputAction
{
protected:
  explicit InputAction(unsigned int pPosition);

public:
  virtual ~InputAction();

  virtual bool activate(InputBuilder&) const = 0;

  unsigned int position() const { return m_Position; }

  bool operator<(const InputAction& pOther) const
  { return (position() < pOther.position()); }

private:
  InputAction();                               // DO_NOT_IMPLEMENT
  InputAction(const InputAction& );            // DO_NOT_IMPLEMENT
  InputAction& operator=(const InputAction& ); // DO_NOT_IMPLEMENT

private:
  unsigned int m_Position;
};

} // namespace of mcld

#endif