InputAction.h revision 87f34658dec9097d987d254a990ea7f311bfc95f
1//===- InputAction.h ------------------------------------------------------===//
2//
3//                     The MCLinker Project
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9#ifndef MCLD_MC_INPUTACTION_H
10#define MCLD_MC_INPUTACTION_H
11#ifdef ENABLE_UNITTEST
12#include <gtest.h>
13#endif
14
15namespace mcld {
16
17class SearchDirs;
18class InputBuilder;
19
20//===----------------------------------------------------------------------===//
21// Base InputAction
22//===----------------------------------------------------------------------===//
23/** \class InputAction
24 *  \brief InputAction is a command object to construct mcld::InputTree.
25 */
26class InputAction
27{
28protected:
29  explicit InputAction(unsigned int pPosition);
30
31public:
32  virtual ~InputAction();
33
34  virtual bool activate(InputBuilder&) const = 0;
35
36  unsigned int position() const { return m_Position; }
37
38  bool operator<(const InputAction& pOther) const
39  { return (position() < pOther.position()); }
40
41private:
42  InputAction();                               // DO_NOT_IMPLEMENT
43  InputAction(const InputAction& );            // DO_NOT_IMPLEMENT
44  InputAction& operator=(const InputAction& ); // DO_NOT_IMPLEMENT
45
46private:
47  unsigned int m_Position;
48};
49
50} // namespace of mcld
51
52#endif
53
54