Add signal and dummy-signal
parent
824129e462
commit
5d001e2c7c
|
@ -98,6 +98,7 @@ set(HEADERS
|
|||
"src/control.h"
|
||||
"src/peer.h"
|
||||
"src/signal.h"
|
||||
"src/dummysignal.h"
|
||||
"src/fakeaudiocapturemodule.h"
|
||||
)
|
||||
|
||||
|
@ -106,6 +107,7 @@ set(SOURCES
|
|||
"src/control.cc"
|
||||
"src/peer.cc"
|
||||
"src/signal.cc"
|
||||
"src/dummysignal.cc"
|
||||
"src/fakeaudiocapturemodule.cc"
|
||||
)
|
||||
|
||||
|
|
|
@ -3,10 +3,16 @@
|
|||
*
|
||||
* Ryan Lee (ryan.lee at throughnet.com)
|
||||
*/
|
||||
|
||||
|
||||
#include "config.h"
|
||||
#include "throughnet.h"
|
||||
|
||||
|
||||
#include "dummysignal.h"
|
||||
|
||||
namespace tn {
|
||||
|
||||
bool DummySignal::Connect() {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace tn
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright 2016 The ThroughNet Project Authors. All rights reserved.
|
||||
*
|
||||
* Ryan Lee (ryan.lee at throughnet.com)
|
||||
*/
|
||||
|
||||
#ifndef __THROUGHNET_DUMMY_SIGNAL_H__
|
||||
#define __THROUGHNET_DUMMY_SIGNAL_H__
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include "signal.h"
|
||||
|
||||
namespace tn {
|
||||
|
||||
class DummySignal
|
||||
: public Signal {
|
||||
public:
|
||||
|
||||
virtual bool Connect();
|
||||
|
||||
private:
|
||||
|
||||
}; // class DummySignal
|
||||
|
||||
} // namespace tn
|
||||
|
||||
|
||||
#endif // __THROUGHNET_DUMMY_SIGNAL_H__
|
||||
|
|
@ -7,3 +7,9 @@
|
|||
#include "config.h"
|
||||
#include "signal.h"
|
||||
|
||||
namespace tn {
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace tn
|
37
src/signal.h
37
src/signal.h
|
@ -4,8 +4,37 @@
|
|||
* Ryan Lee (ryan.lee at throughnet.com)
|
||||
*/
|
||||
|
||||
#ifndef __THROUGHNET_SIGNAL_H__
|
||||
#define __THROUGHNET_SIGNAL_H__
|
||||
|
||||
|
||||
#ifndef __THROUGHNET_SIGNAL_H__
|
||||
#define __THROUGHNET_SIGNAL_H__
|
||||
|
||||
#include <string>
|
||||
#include "webrtc/base/scoped_ref_ptr.h"
|
||||
#include "webrtc/base/refcount.h"
|
||||
#include "webrtc/base/sigslot.h"
|
||||
|
||||
|
||||
namespace tn {
|
||||
|
||||
class SignalInterface
|
||||
: public rtc::RefCountInterface {
|
||||
public:
|
||||
virtual bool Connect() = 0;
|
||||
|
||||
// sigslots
|
||||
sigslot::signal1<std::string*> SignalOnConnected;
|
||||
|
||||
};
|
||||
|
||||
class Signal
|
||||
: public SignalInterface {
|
||||
public:
|
||||
virtual bool Connect() { return false; }
|
||||
|
||||
private:
|
||||
|
||||
}; // class Signal
|
||||
|
||||
|
||||
} // namespace tn
|
||||
|
||||
#endif // __THROUGHNET_SIGNAL_H__
|
Loading…
Reference in New Issue