[PATCH 3/3] [MAMAC] mamaPublisherImpl_getTransportImpl() accessor


Gary Molloy <g.molloy@...>
 

Testing Strategy:-

Not middleware specific. 

 

To test this simply add the following lines to the mamapublisherc.c example application within the createPublisher() function:


mamaTransport tport = mamaPublisherImpl_getTransportImpl (gPublisher);
const char* myTportName = NULL;
mamaTransport_getName (tport, &myTportName);
printf ("TEST: mamaPublisherImpl_getTransportImpl: %s\n", myTportName);


Running the modified mamapublisherc, for example:


./mamapublisherc -m wmw -tport tcp_sub

 

You can expect to see the following output:

 

Created inbound subscription.
TEST: mamaPublisherImpl_getTransportImpl: tcp_sub <------- returns transport

Publishing message 0 to MAMA_TOPIC. msg={MdMsgStatus[2]=0,MdSeqNum[10]=0,PublisherTopic[10002]=MAMA_TOPIC}
Publishing message 1 to MAMA_TOPIC. msg={MdMsgStatus[2]=0,MdSeqNum[10]=1,PublisherTopic[10002]=MAMA_TOPIC}

 

 

=========================================================================================================

 

 

From 8d3b6b92deacc0aae262984245fca5c70923d2b3 Mon Sep 17 00:00:00 2001

From: Gary Molloy <g.molloy@...>

Date: Tue, 21 Apr 2015 10:09:53 -0400

Subject: [PATCH 3/3] [MAMAC] mamaPublisherImpl_getTransportImpl() accessor

 

Added a new mamaPublisherImpl_getTransportImpl() accessor method

that will return the mamaTransport from the mamaPublisher.

 

Signed-off-by: Gary Molloy <g.molloy@...>

---

mama/c_cpp/src/c/publisher.c     |    7 +++++++

mama/c_cpp/src/c/publisherimpl.h |    3 +++

2 files changed, 10 insertions(+), 0 deletions(-)

 

diff --git a/mama/c_cpp/src/c/publisher.c b/mama/c_cpp/src/c/publisher.c

index 281b054..e09017c 100644

--- a/mama/c_cpp/src/c/publisher.c

+++ b/mama/c_cpp/src/c/publisher.c

@@ -600,4 +600,11 @@ mama_status mamaPublisherImpl_clearTransport (mamaPublisher publisher)

     return mamaPublisherImpl_destroy((mamaPublisherImpl *)publisher);

}

+mamaTransport

+mamaPublisherImpl_getTransportImpl (mamaPublisher publisher)

+{

+    mamaPublisherImpl* impl   = (mamaPublisherImpl*)publisher;

+    if (!impl) return NULL;

+    return impl->mTport;

+}

diff --git a/mama/c_cpp/src/c/publisherimpl.h b/mama/c_cpp/src/c/publisherimpl.h

index f336fd8..b9b9c43 100644

--- a/mama/c_cpp/src/c/publisherimpl.h

+++ b/mama/c_cpp/src/c/publisherimpl.h

@@ -44,6 +44,9 @@ mamaPublisher_sendFromInboxByIndex (mamaPublisher publisher,

 mama_status mamaPublisherImpl_clearTransport (mamaPublisher publisher);

+extern mamaTransport

+mamaPublisherImpl_getTransportImpl (mamaPublisher publisher);

+

#if defined(__cplusplus)

}

#endif

--

1.7.1

 

 

 

Gary Molloy – SR Labs

Adelaide Exchange | 24-26 Adelaide Street | Belfast | BT2 8GD

g.molloy@...

 

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.