Continues migration with DDS, Common
This commit is contained in:
1 parent
9b15cee841
commit
fa48db111e
668 files changed
+111841
-2
No files matched your search
Executable
+45
@@ -0,0 +1,45 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <QString>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
namespace LtsUtils
|
||||
{
|
||||
|
||||
template<typename T, typename C>
|
||||
class PgArray
|
||||
{
|
||||
public:
|
||||
using Type = T;
|
||||
using ContainerType = C;
|
||||
|
||||
PgArray() = default;
|
||||
Q_DECL_CONSTEXPR explicit PgArray(const C &data)
|
||||
: m_data(data)
|
||||
{}
|
||||
|
||||
Q_DECL_CONSTEXPR C operator()()const
|
||||
{
|
||||
return m_data;
|
||||
}
|
||||
|
||||
QString toPgString() const;
|
||||
static PgArray fromPgString(const QString &str);
|
||||
private:
|
||||
C m_data;
|
||||
};
|
||||
|
||||
|
||||
|
||||
using IntArray = PgArray<int, std::vector<int>>;
|
||||
using BigintArray = PgArray<int64_t, std::vector<int64_t>>;
|
||||
|
||||
|
||||
using IntArray2D = PgArray<int, std::map<int, int>>;
|
||||
using BigintArray2D = PgArray<int64_t, std::map<int64_t, int64_t>>;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user