Class SubscriberListener, it should be used by the end user to implement specific callbacks to certain actions.
using namespace eprosima::pubsub;
using namespace eprosima::rtps;
{
public:
TestTypeListener()
{
}
~TestTypeListener()
{
}
{
cout << "New Message" << endl;
}
Subscriber* sub,
MatchingInfo& info)
{
if (info.status == MATCHED_MATCHING)
{
cout << "Discovery" << endl;
}
else if (info.status == REMOVED_MATCHING)
{
cout << "Publisher removed" << endl;
}
}
};
TestTypeListener listener;
Subscriber* sub = DomainRTPSParticipant::createSubscriber(p, Rparam, (
SubscriberListener*)&listener);
TestTypeListener listener2;
virtual void onSubscriptionMatched(Subscriber *sub, rtps::MatchingInfo &info)
Virtual method to be called when the subscriber is matched with a new Writer (or unmatched); i....
Definition: SubscriberListener.h:62
SubscriberListener()
Definition: SubscriberListener.h:44
virtual void onNewDataMessage(Subscriber *sub)
Virtual function to be implemented by the user containing the actions to be performed when a new Data...
Definition: SubscriberListener.h:52