/** @file * @author Edouard DUPIN * @copyright 2015, Edouard DUPIN, all right reserved * @license APACHE v2.0 (see license file) */ #include #include #include static bool river_isInit = false; static std::string river_configFile = ""; void river::init(const std::string& _filename) { if (river_isInit == false) { river_isInit = true; river_configFile = _filename; RIVER_DEBUG("init RIVER :" << river_configFile); std11::shared_ptr mng = river::io::Manager::getInstance(); if (mng != nullptr) { mng->init(river_configFile); } } else { RIVER_ERROR("River is already init not use : " << _filename); } } void river::initString(const std::string& _config) { if (river_isInit == false) { river_isInit = true; river_configFile = _config; RIVER_DEBUG("init RIVER with config."); std11::shared_ptr mng = river::io::Manager::getInstance(); if (mng != nullptr) { mng->initString(river_configFile); } } else { RIVER_ERROR("River is already init not use Data ..."); } } void river::unInit() { if (river_isInit == true) { river_isInit = false; RIVER_DEBUG("un-init RIVER."); std11::shared_ptr mng = river::io::Manager::getInstance(); if (mng != nullptr) { RIVER_ERROR("Can not get on the RIVER hardware manager !!!"); mng->unInit(); } } } bool river::isInit() { return river_isInit; }