|
Revision 32, 2.5 kB
(checked in by ross, 3 years ago)
|
removed unused private members, made ProcessBundle? a protected virtual member to allow overriding, changed header reference to virtual to avoid include directory problems when installed
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
#ifndef INCLUDED_OSCPACKETLISTENER_H |
|---|
| 31 |
#define INCLUDED_OSCPACKETLISTENER_H |
|---|
| 32 |
|
|---|
| 33 |
#include "OscReceivedElements.h" |
|---|
| 34 |
#include "../ip/PacketListener.h" |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
namespace osc{ |
|---|
| 38 |
|
|---|
| 39 |
class OscPacketListener : public PacketListener{ |
|---|
| 40 |
protected: |
|---|
| 41 |
virtual void ProcessBundle( const osc::ReceivedBundle& b, |
|---|
| 42 |
const IpEndpointName& remoteEndpoint ) |
|---|
| 43 |
{ |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
for( ReceivedBundle::const_iterator i = b.ElementsBegin(); |
|---|
| 47 |
i != b.ElementsEnd(); ++i ){ |
|---|
| 48 |
if( i->IsBundle() ) |
|---|
| 49 |
ProcessBundle( ReceivedBundle(*i), remoteEndpoint ); |
|---|
| 50 |
else |
|---|
| 51 |
ProcessMessage( ReceivedMessage(*i), remoteEndpoint ); |
|---|
| 52 |
} |
|---|
| 53 |
} |
|---|
| 54 |
|
|---|
| 55 |
virtual void ProcessMessage( const osc::ReceivedMessage& m, |
|---|
| 56 |
const IpEndpointName& remoteEndpoint ) = 0; |
|---|
| 57 |
|
|---|
| 58 |
public: |
|---|
| 59 |
virtual void ProcessPacket( const char *data, int size, |
|---|
| 60 |
const IpEndpointName& remoteEndpoint ) |
|---|
| 61 |
{ |
|---|
| 62 |
osc::ReceivedPacket p( data, size ); |
|---|
| 63 |
if( p.IsBundle() ) |
|---|
| 64 |
ProcessBundle( ReceivedBundle(p), remoteEndpoint ); |
|---|
| 65 |
else |
|---|
| 66 |
ProcessMessage( ReceivedMessage(p), remoteEndpoint ); |
|---|
| 67 |
} |
|---|
| 68 |
}; |
|---|
| 69 |
|
|---|
| 70 |
} |
|---|
| 71 |
|
|---|
| 72 |
#endif |
|---|