OpenKO Database Model
Table- and column-level documentation generated from the jsonSchema
Loading...
Searching...
No Matches
VersionManagerModel.h
1#ifndef VERSIONMANAGER_MODEL_VERSIONMANAGERMODEL_H
2#define VERSIONMANAGER_MODEL_VERSIONMANAGERMODEL_H
3
4#pragma once
5
6#include <ModelUtil/ModelUtil.h>
7#include <cstdint>
8#include <string>
9#include <unordered_set>
10#include <vector>
11
12namespace versionmanager_binder
13{
14 class Concurrent;
15 class CurrentUser;
16 class TbUser;
17 class Version;
18}
19
20namespace versionmanager_model
21{
26 {
28 public:
29 using BinderType = versionmanager_binder::Concurrent;
30
34 uint8_t ServerId = {};
35
39 int16_t Zone1Count = {};
40
44 int16_t Zone2Count = {};
45
49 int16_t Zone3Count = {};
50
52 static const std::string& TableName();
53
55 static const std::unordered_set<std::string>& ColumnNames();
56
58 static const std::vector<std::string>& OrderedColumnNames();
59
61 static const std::unordered_set<std::string>& BlobColumns();
62
65
67 static const std::vector<std::string>& PrimaryKey();
68
70 const uint8_t& MapKey() const;
71
72 };
73
78 {
80 public:
81 using BinderType = versionmanager_binder::CurrentUser;
82
86 int32_t ServerId = {};
87
91 std::string ServerIP;
92
96 std::string AccountId;
97
99 static const std::string& TableName();
100
102 static const std::unordered_set<std::string>& ColumnNames();
103
105 static const std::vector<std::string>& OrderedColumnNames();
106
108 static const std::unordered_set<std::string>& BlobColumns();
109
111 static modelUtil::DbType DbType();
112
114 static const std::vector<std::string>& PrimaryKey();
115
117 const std::string& MapKey() const;
118
119 };
120
124 class TbUser
125 {
127 public:
128 using BinderType = versionmanager_binder::TbUser;
129
133 std::string AccountId;
134
138 std::string Password;
139
143 uint8_t Authority = {};
144
146 static const std::string& TableName();
147
149 static const std::unordered_set<std::string>& ColumnNames();
150
152 static const std::vector<std::string>& OrderedColumnNames();
153
155 static const std::unordered_set<std::string>& BlobColumns();
156
158 static modelUtil::DbType DbType();
159
161 static const std::vector<std::string>& PrimaryKey();
162
164 const std::string& MapKey() const;
165
166 };
167
171 class Version
172 {
174 public:
175 using BinderType = versionmanager_binder::Version;
176
180 int16_t Number = {};
181
185 std::string FileName;
186
190 std::string CompressName;
191
195 int16_t HistoryVersion = {};
196
198 static const std::string& TableName();
199
201 static const std::unordered_set<std::string>& ColumnNames();
202
204 static const std::vector<std::string>& OrderedColumnNames();
205
207 static const std::unordered_set<std::string>& BlobColumns();
208
210 static modelUtil::DbType DbType();
211
213 static const std::vector<std::string>& PrimaryKey();
214
216 const int16_t& MapKey() const;
217
218 };
219}
220
221#endif // VERSIONMANAGER_MODEL_VERSIONMANAGERMODEL_H
generated nanodbc column binder for versionmanager_model::Concurrent
Definition VersionManagerBinder.h:27
generated nanodbc column binder for versionmanager_model::CurrentUser
Definition VersionManagerBinder.h:53
generated nanodbc column binder for versionmanager_model::TbUser
Definition VersionManagerBinder.h:76
generated nanodbc column binder for versionmanager_model::Version
Definition VersionManagerBinder.h:99
[CONCURRENT] Keeps track of concurrent user counts
Definition VersionManagerModel.h:26
int16_t Zone3Count
Column [zone3_count]: Zone 3 Count.
Definition VersionManagerModel.h:49
int16_t Zone2Count
Column [zone2_count]: Zone 2 Count.
Definition VersionManagerModel.h:44
uint8_t ServerId
Column [serverid]: Server Identifier.
Definition VersionManagerModel.h:34
static const std::string & TableName()
Returns the table name.
Definition VersionManagerModel.cpp:6
const uint8_t & MapKey() const
Returns a value for use in map keys based on the table's primary key.
Definition VersionManagerModel.cpp:59
int16_t Zone1Count
Column [zone1_count]: Zone 1 Count.
Definition VersionManagerModel.h:39
static const std::vector< std::string > & OrderedColumnNames()
Returns an ordered vector of column names for the table.
Definition VersionManagerModel.cpp:23
static const std::unordered_set< std::string > & BlobColumns()
Returns a set of blob column names for the table.
Definition VersionManagerModel.cpp:33
static const std::unordered_set< std::string > & ColumnNames()
Returns a set of column names for the table.
Definition VersionManagerModel.cpp:13
static const std::vector< std::string > & PrimaryKey()
Returns the columns associated with the table's Primary Key.
Definition VersionManagerModel.cpp:49
static modelUtil::DbType DbType()
Returns the associated database type for the table.
Definition VersionManagerModel.cpp:43
[CURRENTUSER] Keeps track of users currently connected to the server
Definition VersionManagerModel.h:78
static const std::string & TableName()
Returns the table name.
Definition VersionManagerModel.cpp:64
static const std::vector< std::string > & PrimaryKey()
Returns the columns associated with the table's Primary Key.
Definition VersionManagerModel.cpp:107
std::string AccountId
Column [strAccountID]: User Account Identifier.
Definition VersionManagerModel.h:96
static modelUtil::DbType DbType()
Returns the associated database type for the table.
Definition VersionManagerModel.cpp:101
std::string ServerIP
Column [strServerIP]: Server IP Address.
Definition VersionManagerModel.h:91
static const std::unordered_set< std::string > & BlobColumns()
Returns a set of blob column names for the table.
Definition VersionManagerModel.cpp:91
int32_t ServerId
Column [nServerNo]: Server Index.
Definition VersionManagerModel.h:86
static const std::vector< std::string > & OrderedColumnNames()
Returns an ordered vector of column names for the table.
Definition VersionManagerModel.cpp:81
const std::string & MapKey() const
Returns a value for use in map keys based on the table's primary key.
Definition VersionManagerModel.cpp:117
static const std::unordered_set< std::string > & ColumnNames()
Returns a set of column names for the table.
Definition VersionManagerModel.cpp:71
[TB_USER] User Account Information
Definition VersionManagerModel.h:125
const std::string & MapKey() const
Returns a value for use in map keys based on the table's primary key.
Definition VersionManagerModel.cpp:175
static modelUtil::DbType DbType()
Returns the associated database type for the table.
Definition VersionManagerModel.cpp:159
static const std::unordered_set< std::string > & BlobColumns()
Returns a set of blob column names for the table.
Definition VersionManagerModel.cpp:149
std::string AccountId
Column [strAccountID]: Account identifier.
Definition VersionManagerModel.h:133
static const std::vector< std::string > & OrderedColumnNames()
Returns an ordered vector of column names for the table.
Definition VersionManagerModel.cpp:139
static const std::vector< std::string > & PrimaryKey()
Returns the columns associated with the table's Primary Key.
Definition VersionManagerModel.cpp:165
uint8_t Authority
Column [strAuthority]: Authority level.
Definition VersionManagerModel.h:143
std::string Password
Column [strPasswd]: Password.
Definition VersionManagerModel.h:138
static const std::unordered_set< std::string > & ColumnNames()
Returns a set of column names for the table.
Definition VersionManagerModel.cpp:129
static const std::string & TableName()
Returns the table name.
Definition VersionManagerModel.cpp:122
[VERSION] Version data and patch management
Definition VersionManagerModel.h:172
std::string FileName
Column [strFileName]: Patch file name.
Definition VersionManagerModel.h:185
static const std::vector< std::string > & PrimaryKey()
Returns the columns associated with the table's Primary Key.
Definition VersionManagerModel.cpp:223
static modelUtil::DbType DbType()
Returns the associated database type for the table.
Definition VersionManagerModel.cpp:217
int16_t Number
Column [sVersion]: Game version number.
Definition VersionManagerModel.h:180
static const std::unordered_set< std::string > & BlobColumns()
Returns a set of blob column names for the table.
Definition VersionManagerModel.cpp:207
const int16_t & MapKey() const
Returns a value for use in map keys based on the table's primary key.
Definition VersionManagerModel.cpp:233
static const std::unordered_set< std::string > & ColumnNames()
Returns a set of column names for the table.
Definition VersionManagerModel.cpp:187
static const std::vector< std::string > & OrderedColumnNames()
Returns an ordered vector of column names for the table.
Definition VersionManagerModel.cpp:197
static const std::string & TableName()
Returns the table name.
Definition VersionManagerModel.cpp:180
int16_t HistoryVersion
Column [sHistoryVersion]: Previous patch version.
Definition VersionManagerModel.h:195
std::string CompressName
Column [strCompressName]: User-friendly patch name.
Definition VersionManagerModel.h:190
DbType
Database type identifier.
Definition ModelUtil.h:14