Change directory structure

This commit is contained in:
2023-02-14 14:05:45 -05:00
parent acad4291b6
commit def6387ca3
323 changed files with 161 additions and 19581 deletions

19
luprex/cpp/wrap/mkstub.py Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/python3
import sys
base=sys.argv[1]
ubase=base.upper()
dash=base.replace("_", "-")
with open(f"wrap-{dash}.hpp", "w") as f:
print(f"#ifndef WRAP_{ubase}_HPP", file=f)
print(f"#define WRAP_{ubase}_HPP", file=f)
print("", file=f)
print('#include "eng-malloc.hpp"', file=f)
print(f"#include <{base}>", file=f)
print("", file=f)
print("namespace eng {", file=f)
print("} // namespace eng", file=f)
print("", file=f)
print(f"#endif // WRAP_{ubase}_HPP", file=f)

View File

@@ -0,0 +1,14 @@
#ifndef WRAP_BYTELL_HASH_MAP_HPP
#define WRAP_BYTELL_HASH_MAP_HPP
#include "eng-malloc.hpp"
#include "bytell-hash-map.hpp"
namespace eng {
template<class K, class V, class H=std::hash<K>, class E=std::equal_to<K>>
class bytell_hash_map : public ska::bytell_hash_map<K, V, H, E, eng::allocator<std::pair<const K, V>>>, public eng::opnew {
using ska::bytell_hash_map<K, V, H, E, eng::allocator<std::pair<const K, V>>>::bytell_hash_map;
};
} // namespace eng
#endif // WRAP_BYTELL_HASH_MAP_HPP

View File

@@ -0,0 +1,14 @@
#ifndef WRAP_DEQUE_HPP
#define WRAP_DEQUE_HPP
#include "eng-malloc.hpp"
#include <deque>
namespace eng {
template<class T>
class deque : public std::deque<T, eng::allocator<T>>, public eng::opnew {
using std::deque<T, eng::allocator<T>>::deque;
};
} // namespace eng
#endif // WRAP_DEQUE_HPP

View File

@@ -0,0 +1,14 @@
#ifndef WRAP_MAP_HPP
#define WRAP_MAP_HPP
#include "eng-malloc.hpp"
#include <map>
namespace eng {
template<class K, class V, class C=std::less<K>>
class map : public std::map<K, V, C, eng::allocator<std::pair<const K, V>>>, eng::opnew {
using std::map<K, V, C, eng::allocator<std::pair<const K, V>>>::map;
};
} // namespace eng
#endif // WRAP_MAP_HPP

View File

@@ -0,0 +1,14 @@
#ifndef WRAP_SET_HPP
#define WRAP_SET_HPP
#include "eng-malloc.hpp"
#include <set>
namespace eng {
template<class K, class C=std::less<K>>
class set : public std::set<K, C, eng::allocator<K>>, public eng::opnew {
using std::set<K, C, eng::allocator<K>>::set;
};
} // namespace eng
#endif // WRAP_SET_HPP

View File

@@ -0,0 +1,18 @@
#ifndef WRAP_SSTREAM_HPP
#define WRAP_SSTREAM_HPP
#include "eng-malloc.hpp"
#include "wrap-string.hpp"
#include <sstream>
#include <string_view>
namespace eng {
template<class C, class T=std::char_traits<C>>
class basic_ostringstream : public std::basic_ostringstream<C, T, eng::allocator<C>>, public eng::opnew {
using underlying = std::basic_ostringstream<C, T, eng::allocator<C>>;
using underlying::basic_ostringstream;
};
using ostringstream = basic_ostringstream<char>;
} // namespace eng
#endif // WRAP_SSTREAM_HPP

View File

@@ -0,0 +1,13 @@
#ifndef WRAP_STRING_HPP
#define WRAP_STRING_HPP
#include "eng-malloc.hpp"
#include <string>
namespace eng {
template<class C, class T=std::char_traits<C>>
using basic_string = std::basic_string<C, T, eng::allocator<C>>;
using string = basic_string<char>;
} // namespace eng
#endif // WRAP_STRING_HPP

View File

@@ -0,0 +1,14 @@
#ifndef WRAP_UNORDERED_MAP_HPP
#define WRAP_UNORDERED_MAP_HPP
#include "eng-malloc.hpp"
#include <unordered_map>
namespace eng {
template<class K, class V, class H=std::hash<K>, class E=std::equal_to<K>>
class unordered_map : public std::unordered_map<K, V, H, E, eng::allocator<std::pair<const K, V>>>, public eng::opnew {
using std::unordered_map<K, V, H, E, eng::allocator<std::pair<const K, V>>>::unordered_map;
};
} // namespace eng
#endif // WRAP_UNORDERED_MAP_HPP

View File

@@ -0,0 +1,14 @@
#ifndef WRAP_UNORDERED_SET_HPP
#define WRAP_UNORDERED_SET_HPP
#include "eng-malloc.hpp"
#include <unordered_set>
namespace eng {
template<class K, class H=std::hash<K>, class E=std::equal_to<K>>
class unordered_set : public std::unordered_set<K, H, E, eng::allocator<K>>, public eng::opnew {
using std::unordered_set<K, H, E, eng::allocator<K>>::unordered_set;
};
} // namespace eng
#endif // WRAP_UNORDERED_SET_HPP

View File

@@ -0,0 +1,14 @@
#ifndef WRAP_VECTOR_HPP
#define WRAP_VECTOR_HPP
#include "eng-malloc.hpp"
#include <vector>
namespace eng {
template<class T>
class vector : public std::vector<T, eng::allocator<T>>, public eng::opnew {
using std::vector<T, eng::allocator<T>>::vector;
};
} // namespace eng
#endif // WRAP_VECTOR_HPP