winlin

rename SrsReloadHandler to ISrsReloadHandler

@@ -452,12 +452,12 @@ int SrsConfig::reload() @@ -452,12 +452,12 @@ int SrsConfig::reload()
452 conf.root = NULL; 452 conf.root = NULL;
453 453
454 // merge config. 454 // merge config.
455 - std::vector<SrsReloadHandler*>::iterator it; 455 + std::vector<ISrsReloadHandler*>::iterator it;
456 456
457 // merge config: listen 457 // merge config: listen
458 if (!srs_directive_equals(root->get("listen"), old_root->get("listen"))) { 458 if (!srs_directive_equals(root->get("listen"), old_root->get("listen"))) {
459 for (it = subscribes.begin(); it != subscribes.end(); ++it) { 459 for (it = subscribes.begin(); it != subscribes.end(); ++it) {
460 - SrsReloadHandler* subscribe = *it; 460 + ISrsReloadHandler* subscribe = *it;
461 if ((ret = subscribe->on_reload_listen()) != ERROR_SUCCESS) { 461 if ((ret = subscribe->on_reload_listen()) != ERROR_SUCCESS) {
462 srs_error("notify subscribes reload listen failed. ret=%d", ret); 462 srs_error("notify subscribes reload listen failed. ret=%d", ret);
463 return ret; 463 return ret;
@@ -468,7 +468,7 @@ int SrsConfig::reload() @@ -468,7 +468,7 @@ int SrsConfig::reload()
468 // merge config: pithy_print 468 // merge config: pithy_print
469 if (!srs_directive_equals(root->get("pithy_print"), old_root->get("pithy_print"))) { 469 if (!srs_directive_equals(root->get("pithy_print"), old_root->get("pithy_print"))) {
470 for (it = subscribes.begin(); it != subscribes.end(); ++it) { 470 for (it = subscribes.begin(); it != subscribes.end(); ++it) {
471 - SrsReloadHandler* subscribe = *it; 471 + ISrsReloadHandler* subscribe = *it;
472 if ((ret = subscribe->on_reload_pithy_print()) != ERROR_SUCCESS) { 472 if ((ret = subscribe->on_reload_pithy_print()) != ERROR_SUCCESS) {
473 srs_error("notify subscribes pithy_print listen failed. ret=%d", ret); 473 srs_error("notify subscribes pithy_print listen failed. ret=%d", ret);
474 return ret; 474 return ret;
@@ -482,9 +482,9 @@ int SrsConfig::reload() @@ -482,9 +482,9 @@ int SrsConfig::reload()
482 return ret; 482 return ret;
483 } 483 }
484 484
485 -void SrsConfig::subscribe(SrsReloadHandler* handler) 485 +void SrsConfig::subscribe(ISrsReloadHandler* handler)
486 { 486 {
487 - std::vector<SrsReloadHandler*>::iterator it; 487 + std::vector<ISrsReloadHandler*>::iterator it;
488 488
489 it = std::find(subscribes.begin(), subscribes.end(), handler); 489 it = std::find(subscribes.begin(), subscribes.end(), handler);
490 if (it != subscribes.end()) { 490 if (it != subscribes.end()) {
@@ -494,9 +494,9 @@ void SrsConfig::subscribe(SrsReloadHandler* handler) @@ -494,9 +494,9 @@ void SrsConfig::subscribe(SrsReloadHandler* handler)
494 subscribes.push_back(handler); 494 subscribes.push_back(handler);
495 } 495 }
496 496
497 -void SrsConfig::unsubscribe(SrsReloadHandler* handler) 497 +void SrsConfig::unsubscribe(ISrsReloadHandler* handler)
498 { 498 {
499 - std::vector<SrsReloadHandler*>::iterator it; 499 + std::vector<ISrsReloadHandler*>::iterator it;
500 500
501 it = std::find(subscribes.begin(), subscribes.end(), handler); 501 it = std::find(subscribes.begin(), subscribes.end(), handler);
502 if (it == subscribes.end()) { 502 if (it == subscribes.end()) {
@@ -96,14 +96,14 @@ private: @@ -96,14 +96,14 @@ private:
96 bool show_version; 96 bool show_version;
97 std::string config_file; 97 std::string config_file;
98 SrsConfDirective* root; 98 SrsConfDirective* root;
99 - std::vector<SrsReloadHandler*> subscribes; 99 + std::vector<ISrsReloadHandler*> subscribes;
100 public: 100 public:
101 SrsConfig(); 101 SrsConfig();
102 virtual ~SrsConfig(); 102 virtual ~SrsConfig();
103 public: 103 public:
104 virtual int reload(); 104 virtual int reload();
105 - virtual void subscribe(SrsReloadHandler* handler);  
106 - virtual void unsubscribe(SrsReloadHandler* handler); 105 + virtual void subscribe(ISrsReloadHandler* handler);
  106 + virtual void unsubscribe(ISrsReloadHandler* handler);
107 public: 107 public:
108 virtual int parse_options(int argc, char** argv); 108 virtual int parse_options(int argc, char** argv);
109 private: 109 private:
@@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 33
34 #define SRS_STAGE_DEFAULT_INTERVAL_MS 1200 34 #define SRS_STAGE_DEFAULT_INTERVAL_MS 1200
35 35
36 -struct SrsStageInfo : public SrsReloadHandler 36 +struct SrsStageInfo : public ISrsReloadHandler
37 { 37 {
38 int stage_id; 38 int stage_id;
39 int pithy_print_time_ms; 39 int pithy_print_time_ms;
@@ -25,20 +25,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -25,20 +25,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 25
26 #include <srs_core_error.hpp> 26 #include <srs_core_error.hpp>
27 27
28 -SrsReloadHandler::SrsReloadHandler() 28 +ISrsReloadHandler::ISrsReloadHandler()
29 { 29 {
30 } 30 }
31 31
32 -SrsReloadHandler::~SrsReloadHandler() 32 +ISrsReloadHandler::~ISrsReloadHandler()
33 { 33 {
34 } 34 }
35 35
36 -int SrsReloadHandler::on_reload_listen() 36 +int ISrsReloadHandler::on_reload_listen()
37 { 37 {
38 return ERROR_SUCCESS; 38 return ERROR_SUCCESS;
39 } 39 }
40 40
41 -int SrsReloadHandler::on_reload_pithy_print() 41 +int ISrsReloadHandler::on_reload_pithy_print()
42 { 42 {
43 return ERROR_SUCCESS; 43 return ERROR_SUCCESS;
44 } 44 }
@@ -32,11 +32,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -32,11 +32,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 /** 32 /**
33 * the handler for config reload. 33 * the handler for config reload.
34 */ 34 */
35 -class SrsReloadHandler 35 +class ISrsReloadHandler
36 { 36 {
37 public: 37 public:
38 - SrsReloadHandler();  
39 - virtual ~SrsReloadHandler(); 38 + ISrsReloadHandler();
  39 + virtual ~ISrsReloadHandler();
40 public: 40 public:
41 virtual int on_reload_listen(); 41 virtual int on_reload_listen();
42 virtual int on_reload_pithy_print(); 42 virtual int on_reload_pithy_print();
@@ -65,7 +65,7 @@ public: @@ -65,7 +65,7 @@ public:
65 virtual int cycle(); 65 virtual int cycle();
66 }; 66 };
67 67
68 -class SrsServer : public SrsReloadHandler 68 +class SrsServer : public ISrsReloadHandler
69 { 69 {
70 friend class SrsListener; 70 friend class SrsListener;
71 private: 71 private: