20 #ifndef RTC_CONNECTORLISTENER_H 21 #define RTC_CONNECTORLISTENER_H 25 #include <coil/Mutex.h> 26 #include <coil/Guard.h> 30 class cdrMemoryStream;
216 static const char* typeString[] =
220 "ON_BUFFER_WRITE_TIMEOUT",
221 "ON_BUFFER_OVERWRITE",
226 "ON_RECEIVER_TIMEOUT",
228 "CONNECTOR_DATA_LISTENER_NUM" 260 const cdrMemoryStream&
data) = 0;
289 template <
class DataType>
327 const cdrMemoryStream& cdrdata)
330 cdrMemoryStream cdr(cdrdata.bufPtr(), cdrdata.bufSize());
333 std::string endian_type;
337 std::vector<std::string> endian(
coil::split(endian_type,
","));
338 if (endian[0] ==
"little")
340 cdr.setByteSwapFlag(
true);
342 else if (endian[0] ==
"big")
344 cdr.setByteSwapFlag(
false);
368 const DataType&
data) = 0;
544 static const char* typeStr[] =
547 "ON_BUFFER_READ_TIMEOUT",
553 "CONNECTOR_LISTENER_NUM" 606 typedef std::pair<ConnectorDataListener*, bool>
Entry;
688 const cdrMemoryStream& cdrdata);
713 typedef std::pair<ConnectorListener*, bool>
Entry;
839 #endif // RTC_CONNECTORLISTENER_H
ConnectorListeners class.
std::string normalize(std::string &str)
Erase the head/tail blank and replace upper case to lower case.
coil::Properties properties
Connection properties.
std::vector< Entry > m_listeners
ConnectorDataListener class.
coil::Guard< coil::Mutex > Guard
virtual ~ConnectorDataListener()
Destructor.
vstring split(const std::string &input, const std::string &delimiter, bool ignore_empty)
Split string by delimiter.
ConnectorDataListener holder class.
std::pair< ConnectorListener *, bool > Entry
ConnectorDataListenerType
The types of ConnectorDataListener.
static const char * toString(ConnectorListenerType type)
Convert ConnectorListenerType into the string.
const std::string & getProperty(const std::string &key) const
Search for the property with the specified key in this property.
ConnectorDataListenerT class.
std::pair< ConnectorDataListener *, bool > Entry
coil::Guard< coil::Mutex > Guard
ConnectorListenerType
The types of ConnectorListener.
static const char * toString(ConnectorDataListenerType type)
Convert ConnectorDataListenerType into the string.
virtual void operator()(const ConnectorInfo &info, const cdrMemoryStream &data)=0
Virtual Callback method.
virtual ~ConnectorDataListenerT()
Destructor.
std::vector< Entry > m_listeners
ConnectorListener holder class.
virtual void operator()(const ConnectorInfo &info, const cdrMemoryStream &cdrdata)
Callback method.