feat(list): add list templates

This commit is contained in:
fallenoak 2020-09-16 01:28:32 -05:00
parent 7713223e60
commit ced42bbfed
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
8 changed files with 434 additions and 0 deletions

View file

@ -0,0 +1,23 @@
#ifndef STORM_LIST_TS_EXPLICIT_LIST_HPP
#define STORM_LIST_TS_EXPLICIT_LIST_HPP
#include "list/TSGetExplicitLink.hpp"
#include "list/TSList.hpp"
#include <cstdlib>
#define STORM_EXPLICIT_LIST(T, link) TSExplicitList<T, offsetof(T, link)>
template <class T, size_t offset>
class TSExplicitList : public TSList<T, TSGetExplicitLink<T>> {
public:
// Member functions
TSExplicitList();
};
template <class T, size_t offset>
TSExplicitList<T, offset>::TSExplicitList()
: TSList<T, TSGetExplicitLink<T>>() {
this->SetLinkOffset(offset);
}
#endif