rose: Use an interpreter for role runtime

Replace much of the RoseRole structure with an interpreted program,
simplifying the Rose runtime and making it much more flexible.
This commit is contained in:
Justin Viiret
2015-11-19 09:32:05 +11:00
committed by Matthew Barr
parent a7d8dafb71
commit 9cb2233589
14 changed files with 1682 additions and 1197 deletions

View File

@@ -100,8 +100,9 @@ std::set<typename C::key_type> assoc_keys(const C &container) {
/**
* \brief Return the length in bytes of the given vector of (POD) objects.
*/
template<typename T>
typename std::vector<T>::size_type byte_length(const std::vector<T> &vec) {
template <typename T, typename Alloc>
typename std::vector<T, Alloc>::size_type
byte_length(const std::vector<T, Alloc> &vec) {
static_assert(std::is_pod<T>::value, "should be pod");
return vec.size() * sizeof(T);
}
@@ -110,8 +111,8 @@ typename std::vector<T>::size_type byte_length(const std::vector<T> &vec) {
* \brief Copy the given vector of POD objects to the given location in memory.
* It is safe to give this function an empty vector.
*/
template<typename T>
void *copy_bytes(void *dest, const std::vector<T> &vec) {
template<typename T, typename Alloc>
void *copy_bytes(void *dest, const std::vector<T, Alloc> &vec) {
static_assert(std::is_pod<T>::value, "should be pod");
assert(dest);