13#ifndef SEIMS_DATA_CENTER_MONGODB_H
14#define SEIMS_DATA_CENTER_MONGODB_H
136 const
char* GetHostIp()
const {
return mongodb_ip_; }
137 uint16_t GetPort()
const {
return mongodb_port_; }
138 string GetClimateDBName()
const {
return clim_dbname_; }
139 string GetScenarioDBName()
const {
return scenario_dbname_; }
140 MongoClient* GetMongoClient()
const {
return mongo_client_; }
141 MongoDatabase* GetMainDatabase()
const {
return main_database_; }
142 MongoGridFs* GetMongoGridFs()
const {
return spatial_gridfs_; }
143 MongoGridFs* GetMongoGridFsOutput()
const {
return spatial_gfs_out_; }
145 const char* mongodb_ip_;
146 const uint16_t mongodb_port_;
148 string scenario_dbname_;
Data center for running SEIMS including configuration, input data, output data, etc.
#define OVERRIDE
A compatible reference to override or blank if not supported by the compiler.
Definition: basic.h:160
A simple wrapper of the class of MongoDB Client mongoc_client_t.
Definition: db_mongoc.h:46
A simple wrapper of the class of MongoDB database mongoc_database_t.
Definition: db_mongoc.h:97
A simple wrapper of the class of MongoDB database mongoc_gridfs_t.
Definition: db_mongoc.h:141
bool ReadParametersInDB() OVERRIDE
Read initial and calibrated parameters.
bool GetFileInStringVector() OVERRIDE
Get file.in configuration from FILE_IN collection.
bool ReadRasterData(const string &remote_filename, FloatRaster *&flt_rst) OVERRIDE
Read raster data, both 1D and 2D, and insert to m_rsMap.
void Read2DArrayData(const string &remote_filename, int &rows, int &cols, FLTPT **&data) OVERRIDE
Read 2D array data from MongoDB database.
void Read1DArrayData(const string &remote_filename, int &num, FLTPT *&data) OVERRIDE
Read 1D array data from MongoDB and insert to m_1DArrayMap CAUTION: Value data type stored in MongoDB...
void ReadIuhData(const string &remote_filename, int &n, FLTPT **&data) OVERRIDE
Read IUH data from MongoDB and insert to m_2DArrayMap.
~DataCenterMongoDB()
Destructor.
bool CheckModelPreparedData() OVERRIDE
Make sure all the required data are presented.
string QueryDatabaseName(bson_t *query, const char *tabname)
Query database name.
void ReadItpWeightData(const string &remote_filename, int &num, int &stations, FLTPT **&data) OVERRIDE
Read interpolated weight data from MongoDB and insert to m_weightDataMap.
bool SetRasterForScenario() OVERRIDE
Set Raster data for Scenario data.
int ReadIntParameterInDB(const char *param_name) OVERRIDE
Get subbasin number and outlet ID.
bool GetFileOutVector() OVERRIDE
Get file.out configuration.
DataCenterMongoDB(InputArgs *input_args, MongoClient *client, MongoGridFs *spatial_gfs_in, MongoGridFs *spatial_gfs_out, ModuleFactory *factory, int subbasin_id=0)
Constructor based on MongoDB.
void ReadClimateSiteList() OVERRIDE
Read climate site data from HydroClimate database.
Base class of Data center for SEIMS.
Definition: DataCenter.h:37
Class of Data center inherited from DataCenter based on MongoDB.
Definition: DataCenterMongoDB.h:24
Linking user-defined modules to create the modeling workflow.
Definition: ModuleFactory.h:40
#define FloatRaster
Float-typed raster with int-typed mask, specific for legacy SEIMS code.
Definition: seims.h:133
#define IntRaster
Integer-typed raster.
Definition: seims.h:126