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 
12 namespace mcld {
13 
14 class SearchDirs;
15 class InputBuilder;
16 
17 //===----------------------------------------------------------------------===//
18 // Base InputAction
19 //===----------------------------------------------------------------------===//
20 /** \class InputAction
21  *  \brief InputAction is a command object to construct mcld::InputTree.
22  */
23 class InputAction {
24  protected:
25   explicit InputAction(unsigned int pPosition);
26 
27  public:
28   virtual ~InputAction();
29 
30   virtual bool activate(InputBuilder&) const = 0;
31 
position()32   unsigned int position() const { return m_Position; }
33 
34   bool operator<(const InputAction& pOther) const {
35     return (position() < pOther.position());
36   }
37 
38  private:
39   InputAction();                               // DO_NOT_IMPLEMENT
40   InputAction(const InputAction&);             // DO_NOT_IMPLEMENT
41   InputAction& operator=(const InputAction&);  // DO_NOT_IMPLEMENT
42 
43  private:
44   unsigned int m_Position;
45 };
46 
47 }  // namespace mcld
48 
49 #endif  // MCLD_MC_INPUTACTION_H_
50