Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GeoModelDev
GeoModel
Commits
08baeab1
Commit
08baeab1
authored
1 year ago
by
Riccardo Maria Bianchi
Browse files
Options
Downloads
Patches
Plain Diff
Load info from DB and create caches as soon as the DB file is opened
parent
53e95434
No related branches found
No related tags found
1 merge request
!199
Update GeoModelExamples
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GeoModelIO/GeoModelDBManager/GeoModelDBManager/GMDBManager.h
+23
-12
23 additions, 12 deletions
GeoModelIO/GeoModelDBManager/GeoModelDBManager/GMDBManager.h
GeoModelIO/GeoModelDBManager/src/GMDBManager.cpp
+165
-135
165 additions, 135 deletions
GeoModelIO/GeoModelDBManager/src/GMDBManager.cpp
with
188 additions
and
147 deletions
GeoModelIO/GeoModelDBManager/GeoModelDBManager/GMDBManager.h
+
23
−
12
View file @
08baeab1
...
@@ -189,8 +189,16 @@ class GMDBManager {
...
@@ -189,8 +189,16 @@ class GMDBManager {
void
printAllDBTables
();
void
printAllDBTables
();
/// Get tables and tables' columns from the input DB, if any,
/// and populate the cache that stores them
void
createTableDataCaches
();
void
createTableDataCaches
();
/// Get all tables from the input DB, if any,
/// and populate the cache that stores them
void
getAllDBTables
();
void
getAllDBTables
();
/// Get tables' columns from the input DB, if any,
/// and populate the cache that stores them
void
getAllDBTableColumns
();
void
getAllDBTableColumns
();
int
execQuery
(
std
::
string
queryStr
);
int
execQuery
(
std
::
string
queryStr
);
...
@@ -247,12 +255,12 @@ class GMDBManager {
...
@@ -247,12 +255,12 @@ class GMDBManager {
/// methods to dump the DB
/// methods to dump the DB
std
::
vector
<
std
::
vector
<
std
::
string
>>
getChildrenTable
();
std
::
vector
<
std
::
vector
<
std
::
string
>>
getChildrenTable
();
//Table names for Aux tables are of the form prefix_suffix
//
Table names for Aux tables are of the form prefix_suffix
//where prefix depends on the type of data in the table
//
where prefix depends on the type of data in the table
//and suffix depends on the plugin/publisher that provided it
//
and suffix depends on the plugin/publisher that provided it
//These two require only the suffix, the prefix is already specified based
on the
//
These two require only the suffix, the prefix is already specified based
//table type being accessed
//
on the
table type being accessed
std
::
vector
<
std
::
vector
<
std
::
string
>>
getPublishedFPVTable
(
std
::
vector
<
std
::
vector
<
std
::
string
>>
getPublishedFPVTable
(
std
::
string
suffix
=
""
);
std
::
string
suffix
=
""
);
std
::
vector
<
std
::
vector
<
std
::
string
>>
getPublishedAXFTable
(
std
::
vector
<
std
::
vector
<
std
::
string
>>
getPublishedAXFTable
(
...
@@ -264,10 +272,11 @@ class GMDBManager {
...
@@ -264,10 +272,11 @@ class GMDBManager {
std
::
unordered_map
<
unsigned
int
,
std
::
string
>
getAll_TableIDsNodeTypes
();
std
::
unordered_map
<
unsigned
int
,
std
::
string
>
getAll_TableIDsNodeTypes
();
std
::
unordered_map
<
std
::
string
,
unsigned
int
>
getAll_NodeTypesTableIDs
();
std
::
unordered_map
<
std
::
string
,
unsigned
int
>
getAll_NodeTypesTableIDs
();
std
::
vector
<
std
::
vector
<
std
::
string
>>
getTableRecords
(
std
::
string
tableName
)
const
;
// TODO: should be private?
std
::
vector
<
std
::
vector
<
std
::
string
>>
getTableRecords
(
std
::
string
tableName
)
const
;
// TODO: should be private?
//Test if a given table exists
//
Test if a given table exists
//This requires the *full* table name (i.e. prefix_suffix)
//
This requires the *full* table name (i.e. prefix_suffix)
bool
checkTable
(
std
::
string
tableName
)
const
;
bool
checkTable
(
std
::
string
tableName
)
const
;
/**
/**
...
@@ -347,12 +356,14 @@ class GMDBManager {
...
@@ -347,12 +356,14 @@ class GMDBManager {
// verbosity level
// verbosity level
int
m_verbose
;
int
m_verbose
;
std
::
unordered_map
<
std
::
string
,
std
::
vector
<
std
::
string
>>
/// stores the column names for each table
m_tableNames
;
/// stores the column names for each table
std
::
unordered_map
<
std
::
string
,
std
::
vector
<
std
::
string
>>
m_tableNames
;
std
::
unordered_map
<
std
::
string
,
std
::
string
>
m_childType_tableName
;
std
::
unordered_map
<
std
::
string
,
std
::
string
>
m_childType_tableName
;
std
::
vector
<
std
::
string
>
/// cache for the list of tables in the DB
m_cache_tables
;
/// cache for the list of tables in the DB
std
::
vector
<
std
::
string
>
m_cache_tables
;
std
::
unordered_map
<
unsigned
int
,
std
::
string
>
std
::
unordered_map
<
unsigned
int
,
std
::
string
>
m_cache_tableId_tableName
;
/// cache for tableID-->tableName
m_cache_tableId_tableName
;
/// cache for tableID-->tableName
std
::
unordered_map
<
unsigned
int
,
std
::
string
>
std
::
unordered_map
<
unsigned
int
,
std
::
string
>
...
...
This diff is collapsed.
Click to expand it.
GeoModelIO/GeoModelDBManager/src/GMDBManager.cpp
+
165
−
135
View file @
08baeab1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment