Add signal and dummy-signal

master
Ryan Lee 2016-03-21 12:06:41 +09:00
parent 824129e462
commit 5d001e2c7c
5 changed files with 81 additions and 8 deletions

View File

@ -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"
)

View File

@ -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

30
src/dummysignal.h Normal file
View File

@ -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__

View File

@ -7,3 +7,9 @@
#include "config.h"
#include "signal.h"
namespace tn {
} // namespace tn

View File

@ -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__