1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

rename SrsReloadHandler to ISrsReloadHandler

This commit is contained in:
winlin 2013-12-14 21:34:54 +08:00
parent 010b7a7595
commit f016914ac1
6 changed files with 19 additions and 19 deletions

View file

@ -452,12 +452,12 @@ int SrsConfig::reload()
conf.root = NULL; conf.root = NULL;
// merge config. // merge config.
std::vector<SrsReloadHandler*>::iterator it; std::vector<ISrsReloadHandler*>::iterator it;
// merge config: listen // merge config: listen
if (!srs_directive_equals(root->get("listen"), old_root->get("listen"))) { if (!srs_directive_equals(root->get("listen"), old_root->get("listen"))) {
for (it = subscribes.begin(); it != subscribes.end(); ++it) { for (it = subscribes.begin(); it != subscribes.end(); ++it) {
SrsReloadHandler* subscribe = *it; ISrsReloadHandler* subscribe = *it;
if ((ret = subscribe->on_reload_listen()) != ERROR_SUCCESS) { if ((ret = subscribe->on_reload_listen()) != ERROR_SUCCESS) {
srs_error("notify subscribes reload listen failed. ret=%d", ret); srs_error("notify subscribes reload listen failed. ret=%d", ret);
return ret; return ret;
@ -468,7 +468,7 @@ int SrsConfig::reload()
// merge config: pithy_print // merge config: pithy_print
if (!srs_directive_equals(root->get("pithy_print"), old_root->get("pithy_print"))) { if (!srs_directive_equals(root->get("pithy_print"), old_root->get("pithy_print"))) {
for (it = subscribes.begin(); it != subscribes.end(); ++it) { for (it = subscribes.begin(); it != subscribes.end(); ++it) {
SrsReloadHandler* subscribe = *it; ISrsReloadHandler* subscribe = *it;
if ((ret = subscribe->on_reload_pithy_print()) != ERROR_SUCCESS) { if ((ret = subscribe->on_reload_pithy_print()) != ERROR_SUCCESS) {
srs_error("notify subscribes pithy_print listen failed. ret=%d", ret); srs_error("notify subscribes pithy_print listen failed. ret=%d", ret);
return ret; return ret;
@ -482,9 +482,9 @@ int SrsConfig::reload()
return ret; return ret;
} }
void SrsConfig::subscribe(SrsReloadHandler* handler) void SrsConfig::subscribe(ISrsReloadHandler* handler)
{ {
std::vector<SrsReloadHandler*>::iterator it; std::vector<ISrsReloadHandler*>::iterator it;
it = std::find(subscribes.begin(), subscribes.end(), handler); it = std::find(subscribes.begin(), subscribes.end(), handler);
if (it != subscribes.end()) { if (it != subscribes.end()) {
@ -494,9 +494,9 @@ void SrsConfig::subscribe(SrsReloadHandler* handler)
subscribes.push_back(handler); subscribes.push_back(handler);
} }
void SrsConfig::unsubscribe(SrsReloadHandler* handler) void SrsConfig::unsubscribe(ISrsReloadHandler* handler)
{ {
std::vector<SrsReloadHandler*>::iterator it; std::vector<ISrsReloadHandler*>::iterator it;
it = std::find(subscribes.begin(), subscribes.end(), handler); it = std::find(subscribes.begin(), subscribes.end(), handler);
if (it == subscribes.end()) { if (it == subscribes.end()) {

View file

@ -96,14 +96,14 @@ private:
bool show_version; bool show_version;
std::string config_file; std::string config_file;
SrsConfDirective* root; SrsConfDirective* root;
std::vector<SrsReloadHandler*> subscribes; std::vector<ISrsReloadHandler*> subscribes;
public: public:
SrsConfig(); SrsConfig();
virtual ~SrsConfig(); virtual ~SrsConfig();
public: public:
virtual int reload(); virtual int reload();
virtual void subscribe(SrsReloadHandler* handler); virtual void subscribe(ISrsReloadHandler* handler);
virtual void unsubscribe(SrsReloadHandler* handler); virtual void unsubscribe(ISrsReloadHandler* handler);
public: public:
virtual int parse_options(int argc, char** argv); virtual int parse_options(int argc, char** argv);
private: private:

View file

@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SRS_STAGE_DEFAULT_INTERVAL_MS 1200 #define SRS_STAGE_DEFAULT_INTERVAL_MS 1200
struct SrsStageInfo : public SrsReloadHandler struct SrsStageInfo : public ISrsReloadHandler
{ {
int stage_id; int stage_id;
int pithy_print_time_ms; int pithy_print_time_ms;

View file

@ -25,20 +25,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core_error.hpp> #include <srs_core_error.hpp>
SrsReloadHandler::SrsReloadHandler() ISrsReloadHandler::ISrsReloadHandler()
{ {
} }
SrsReloadHandler::~SrsReloadHandler() ISrsReloadHandler::~ISrsReloadHandler()
{ {
} }
int SrsReloadHandler::on_reload_listen() int ISrsReloadHandler::on_reload_listen()
{ {
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
int SrsReloadHandler::on_reload_pithy_print() int ISrsReloadHandler::on_reload_pithy_print()
{ {
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }

View file

@ -32,11 +32,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/** /**
* the handler for config reload. * the handler for config reload.
*/ */
class SrsReloadHandler class ISrsReloadHandler
{ {
public: public:
SrsReloadHandler(); ISrsReloadHandler();
virtual ~SrsReloadHandler(); virtual ~ISrsReloadHandler();
public: public:
virtual int on_reload_listen(); virtual int on_reload_listen();
virtual int on_reload_pithy_print(); virtual int on_reload_pithy_print();

View file

@ -65,7 +65,7 @@ public:
virtual int cycle(); virtual int cycle();
}; };
class SrsServer : public SrsReloadHandler class SrsServer : public ISrsReloadHandler
{ {
friend class SrsListener; friend class SrsListener;
private: private: