/usr/include/mama/MamaTransport.h is in libmama-dev 2.2.2.1-11ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | /* $Id$
*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Technologies, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef MAMA_TRANSPORT_CPP_H__
#define MAMA_TRANSPORT_CPP_H__
#include "mama/mama.h"
namespace Wombat
{
class MamaSymbolMap;
class MamaTransport;
class MamaConnection;
class MamaServerConnection;
/**
* TransportTopicEvent callback
*/
class MAMACPPExpDLL MamaTransportTopicEventCallback
{
public:
virtual ~MamaTransportTopicEventCallback()
{
};
/**
* Invoked when a topic is subscribed to.
*/
virtual void onTopicSubscribe (MamaTransport* transport,
const char* topic,
const void* platformInfo)
{
return;
}
virtual void onTopicUnsubscribe (MamaTransport* transport,
const char* topic,
const void* platformInfo)
{
return;
}
};
/**
* Transport callback.
*/
class MAMACPPExpDLL MamaTransportCallback
{
public:
virtual ~MamaTransportCallback()
{
};
/**
* Invoked on a publisher when a subscriber disconnects.
*
* @param transport The transport which has disconnected.
* @param platformInfo Info associated with the event.
*
* The cause and platformInfo are supplied only by some middlewares.
* The information provided by platformInfo is middleware specific.
* The following middlewares are supported:
*
* tibrv: provides the char* version of the tibrv advisory message.
* wmw: provides a pointer to a C mamaConnection struct for the event
*/
virtual void onDisconnect (
MamaTransport* transport,
const void* platformInfo)
{
return;
}
/**
* Invoked when the transport reconnects
*
* @param transport The transport which has reconnected.
* @param platformInfo Info associated with the event.
*
* The cause and platformInfo are supplied only by some middlewares.
* The information provided by platformInfo is middleware specific.
* The following middlewares are supported:
*
* tibrv: provides the char* version of the tibrv advisory message.
* wmw: provides a pointer to a C mamaConnection struct for the event
*/
virtual void onReconnect (
MamaTransport* transport,
const void* platformInfo)
{
return;
}
/**
* Invoked when the quality of this transport changes.
*
* @param transport The transport on which the quality has changed.
* @param cause The cause of the quality event.
* @param platformInfo Info associated with the quality event.
*
* The cause and platformInfo are supplied only by some middlewares.
* The information provided by platformInfo is middleware specific.
* The following middlewares are supported:
*
* tibrv: provides the char* version of the tibrv advisory message.
*/
virtual void onQuality (
MamaTransport* transport,
short cause,
const void* platformInfo) = 0;
/**
* Invoked on the subscriber when the transport connects.
*
* @param transport The transport which has connected.
* @param platformInfo Info associated with the event.
*
* The cause and platformInfo are supplied only by some middlewares.
* The information provided by platformInfo is middleware specific.
* The following middlewares are supported:
*
* wmw: provides a pointer to a C mamaConnection struct for the event
*/
virtual void onConnect (
MamaTransport* transport,
const void* platformInfo)
{
return;
}
/**
* Invoked on the publisher when the transport accepts a connection.
*
* @param transport The transport which has accepted.
* @param platformInfo Info associated with the event.
*
* The cause and platformInfo are supplied only by some middlewares.
* The information provided by platformInfo is middleware specific.
* The following middlewares are supported:
*
* wmw: provides a pointer to a C mamaConnection struct for the event
*/
virtual void onAccept (
MamaTransport* transport,
const void* platformInfo)
{
return;
}
/**
* Invoked on the publisher when the transport accepts a reconnection.
*
* @param transport The transport which has reconnected on
* @param platformInfo Info associated with the event.
*
* The cause and platformInfo are supplied only by some middlewares.
* The information provided by platformInfo is middleware specific.
* The following middlewares are supported:
*
* wmw: provides a pointer to a C mamaConnection struct for the event
*/
virtual void onAcceptReconnect (
MamaTransport* transport,
const void* platformInfo)
{
return;
}
/**
* Invoked on the subscriber when the transport disconnects from the publisher.
*
* @param transport The transport which has disconnected on
* @param platformInfo Info associated with the event.
*
* The cause and platformInfo are supplied only by some middlewares.
* The information provided by platformInfo is middleware specific.
* The following middlewares are supported:
*
* wmw: provides a pointer to a C mamaConnection struct for the event
*/
virtual void onPublisherDisconnect (
MamaTransport* transport,
const void* platformInfo)
{
return;
}
/**
* Invoked on the subscriber when the naming service connects.
*
* @param transport The transport which has connected.
* @param platformInfo Info associated with the event.
*/
virtual void onNamingServiceConnect (
MamaTransport* transport,
const void* platformInfo)
{
return;
}
/**
* Invoked on the subscriber when the naming service disconnects.
*
* @param transport The transport which has connected.
* @param platformInfo Info associated with the event.
*/
virtual void onNamingServiceDisconnect (
MamaTransport* transport,
const void* platformInfo)
{
return;
}
};
/**
* The MamaTransport class provides market data functionality.
*/
class MAMACPPExpDLL MamaTransport
{
public:
/**
* Construct a MamaTransport. Call create to create the transport.
*/
MamaTransport ();
virtual ~MamaTransport ();
/**
* Construct a MamaTransport that wraps a mamaTransport from the C API.
* Mama uses this internally. C++ Applications should create C++
* MamaTransport objects through the no-argument constructor, and call
* MamaTransport::create().
*
* MamaTransport objects created with this method do not deallocate or
* destroy the underlying c Transport because that responsibility lies
* with the creator.
*/
MamaTransport (
mamaTransport cTransport);
/**
* Create a transport. Platform specific parameters are read from
* the properties file. The parameters are
* dependent on the underlying messaging transport.
*
* @param name The transport name
* @param bridgeImpl The middleware-specific bridge structure
*/
void create (
const char* name,
mamaBridge bridgeImpl);
/**
* set the transport name.
* The name string is copied by the object.
*
* @param name The transport name.
*/
void setName (
const char* name);
/**
* get the transport name.
*/
const char* getName () const;
/**
* get the middleware name.
*/
const char* getMiddleware() const;
/**
* Return the outbound throttle rate in messages/second.
*
* @return The throttle rate.
*
*/
double getOutboundThrottle (
mamaThrottleInstance instance = MAMA_THROTTLE_DEFAULT) const;
/**
* Set the throttle rate for outbound message. This rate controls
* the rate at which methods sent with sendWithThrottle (void)
* are sent. A value of 0.0 disables throttling.
*
* @param outboundThrottle The rate in messages/second.
* @param instance the mamaThrottleInstance to use
*/
void setOutboundThrottle (
double outboundThrottle,
mamaThrottleInstance instance = MAMA_THROTTLE_DEFAULT);
/**
* Set the transport topic callback
*/
void setTransportTopicCallback (MamaTransportTopicEventCallback* callback);
/**
* Set the transport callback.
*/
void setTransportCallback (
MamaTransportCallback* callback);
/**
* Get the transport callback.
*/
MamaTransportCallback* getTransportCallback ();
/**
* Set the symbology mapping class.
*
* @param mapper A symbol mapping class.
*/
void setSymbolMap (
const MamaSymbolMap* mapper);
/**
* Return the symbology mapping class.
*/
const MamaSymbolMap* getSymbolMap () const;
/**
* Set the description for the transport.
* The description string is copied by the object.
*
* @param description The transport description.
*/
void setDescription (
const char* description);
/**
* Return the description string for the transport.
* Do not alter or free the string returned by this
* method.
*
* @return const char* The transport description.
*/
const char* getDescription () const;
/*
* Find a connection for the specified IP address and port. If the port is 0
* the first connection for the specified IP address is returned.
*
* The caller must delete() the returned value.
*/
MamaConnection* findConnection (
const char* IpAddress,
uint16_t port);
/*
* Return a list of all connections.
*
* Note. The results (list and len) must be passed to freeAllConnections
* to free the resources allocated by this call.
*/
virtual void getAllConnections (
MamaConnection**& list,
uint32_t& len);
/*
* Free array returned by getAllConnections
*/
virtual void freeAllConnections (
MamaConnection** list,
uint32_t len);
/*
* Return a list of all server connections.
*
* Note. The results (list and len) must be passed to
* freeAllServerConnections to free the resources allocated by this call.
*/
virtual void getAllServerConnections (
MamaServerConnection**& list,
uint32_t& len);
/*
* Free array returned by getAllServerConnections.
*/
virtual void freeAllServerConnections (
MamaServerConnection** list,
uint32_t& len);
/**
* Set whether to invoke the quality callback for all subscriptions
* whenever a data quality event occurs (the default), or
* whether to invoke the quality callback only when data subsequently arrives for a
* subscription.
*
* If set to true, an onQuality callback will be invoked for a subscription
* whenever a data quality event occurs on the transport, even in between
* updates for that description. If set to false, the onQuality callback
* will not be called when the data quality event occurs on the transport.
* However, it will still be invoked when an update arrives for the subscription.
*
* @param invokeQualityForAllSubscs Whether to invoke quality callback for
* all subscriptions
*/
void setInvokeQualityForAllSubscs (
bool invokeQualityForAllSubscs);
/**
* Get whether the transport has been set to invoke the quality callback
* for all subscriptions whenever a data quality event occurs.
*
* @return Whether transport has been set to invoke quality callback for
* all subscriptions
*/
bool getInvokeQualityForAllSubscs () const;
/**
* Get the data quality for the transport.
*
* Currently only supported for the Tibco RV
* middleware. Returns OK for all other middlewares.
*
* @return The Quality of the transport
*/
mamaQuality getQuality () const;
/**
* Request conflation for the transport.
*
* Currently only supported for WMW.
*/
void requestConflation () const;
/**
* Request an end to conflation for the transport.
*
* Currently only supported for WMW.
*/
void requestEndConflation () const;
// Access to C types for implementation of related classes.
mamaTransport getCValue ();
const mamaTransport getCValue () const;
/**
* Return the underlying native transport. Applications should avoid this
* method if possible as it may result in non-portable, middleware specific
* code. Callers must cast the nativeTport to the appropriate type.
*
*
* Note: this method returns the underlying C construct not a C++ object.
*
*/
void* getNativeTransport (
int index);
/**
* Disable refreshing of subscriptions on this transport.
*/
void disableRefresh (
bool disable);
struct MamaTransportImpl;
MamaTransportImpl* mPimpl;
private:
mamaTransport mTransport;
};
} // namespace Wombat
#endif // MAMA_TRANSPORT_CPP_H__
|