The Sparta Modeling Framework
Loading...
Searching...
No Matches
RegisterDefinitionSet.hpp
1#pragma once
2
3#include "sparta/functional/Register.hpp"
4#include "sparta/functional/RegisterSet.hpp"
5
6namespace sparta {
7
15template <typename RegisterT>
17{
18public:
19 using Definition = typename RegisterT::Definition;
20
22 {
23 definitions_.push_back(RegisterT::DEFINITION_END);
24 }
25
32 void addDefinitions(const Definition *definitions)
33 {
34 definitions_.pop_back();
35
36 for (auto i = definitions; *i != RegisterT::DEFINITION_END; ++i) {
37 definitions_.push_back(*i);
38 }
39
40 definitions_.push_back(RegisterT::DEFINITION_END);
41 }
42
47 const Definition *getDefinitions() const
48 {
49 return definitions_.data();
50 }
51
52private:
54 std::vector<Definition> definitions_;
55};
56
61using RegisterDefinitionSet =
62 __RegisterDefintionSet<sparta::RegisterBase>;
63
64using ProxyDefinitionSet =
65 __RegisterDefintionSet<sparta::RegisterProxyBase>;
66
67} /* namespace sparta */
Type that holds a set of register definitions.
const Definition * getDefinitions() const
void addDefinitions(const Definition *definitions)
Macros for handling exponential backoff.