• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 {
25 protected:
26   explicit InputAction(unsigned int pPosition);
27 
28 public:
29   virtual ~InputAction();
30 
31   virtual bool activate(InputBuilder&) const = 0;
32 
position()33   unsigned int position() const { return m_Position; }
34 
35   bool operator<(const InputAction& pOther) const
36   { return (position() < pOther.position()); }
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 of mcld
48 
49 #endif
50 
51