Bitstream Interpretation Library (BIL)  0.1
Register.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 #ifndef BIL_REGISTER_HPP
8 #define BIL_REGISTER_HPP
9 
10 #include <cstring>
11 #include <string>
12 #include <boost/cstdint.hpp>
14 
15 
16 namespace bil {
17 
25  class Register {
26  public:
27 
28  /**********************************************************************/
29  /* CONSTRUCTION / DESTRUCTION */
30  /**********************************************************************/
31 
41  Register(RegisterAddress::address_t address, const std::string& name, bool writable = true, bool readable = true);
42 
46  virtual ~Register() = 0;
47 
48 
49  /**********************************************************************/
50  /* REGISTER PROPERTIES */
51  /**********************************************************************/
52 
58 
63  const std::string& name() const;
64 
69  bool writable() const;
70 
75  bool readable() const;
76 
77 
78  /**********************************************************************/
79  /* REGISTER I/O */
80  /**********************************************************************/
81 
92  virtual void write(const boost::uint32_t* words, size_t wordCount);
93 
104  virtual void read(boost::uint32_t* words, size_t wordCount) const;
105 
106 
107  private:
108 
109  Register(const Register&);
110  Register& operator=(const Register&);
111 
112  const std::string m_name;
113  const RegisterAddress::address_t m_address;
114  const bool m_writable;
115  const bool m_readable;
116 
117  };
118 
119 }
120 
121 #endif