本文整理汇总了C++中SubscriptionList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ SubscriptionList::push_back方法的具体用法?C++ SubscriptionList::push_back怎么用?C++ SubscriptionList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SubscriptionList
的用法示例。
在下文中一共展示了SubscriptionList::push_back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: subscribeToSymbols
void BookPublisher::subscribeToSymbols ()
{
for (vector<const char*>::const_iterator i = mSymbolList.begin ();
i != mSymbolList.end ();
++i)
{
const char* symbol = *i;
mBook = new MamdaOrderBook();
// Turn on delta generation
mBook->generateDeltaMsgs(true);
MamdaSubscription* aSubscription = new MamdaSubscription;
MamdaOrderBookListener* aBookListener = new MamdaOrderBookListener(mBook);
aSubscription->addMsgListener (aBookListener);
aBookListener->setProcessEntries (mProcessEntries);
BookTicker* aTicker = new BookTicker;
aBookListener->addHandler (aTicker);
aSubscription->setType (MAMA_SUBSC_TYPE_BOOK);
aSubscription->setMdDataType (MAMA_MD_DATA_TYPE_ORDER_BOOK);
mSubscriptionList.push_back (aSubscription);
aSubscription->create (Mama::getDefaultEventQueue (mBridge), mSubSource, symbol, NULL);
}
}
示例2: subscribeToSymbol
void MamaEntitle::subscribeToSymbol (const char* symbol)
{
static int howMany = 0;
if (!mDisplayCallback)
{
mDisplayCallback = new DisplayCallback (this);
}
MamaSubscription* sub = NULL;
sub = new MamaSubscription;
sub->setRetries (3);
sub->setRequiresInitial (mRequireInitial);
if (mSnapshot)
{
sub->setSubscriptionType (MAMA_SUBSC_TYPE_NORMAL);
sub->setServiceLevel (MAMA_SERVICE_LEVEL_SNAPSHOT, 0);
}
else if (mGroupSubscription)
{
sub->setSubscriptionType (MAMA_SUBSC_TYPE_GROUP);
sub->setServiceLevel (MAMA_SERVICE_LEVEL_REAL_TIME, 0);
}
else
{
sub->setSubscriptionType (MAMA_SUBSC_TYPE_NORMAL);
sub->setServiceLevel (MAMA_SERVICE_LEVEL_REAL_TIME, 0);
}
sub->create (
mTransport,
mQueueGroup->getNextQueue (),
(DisplayCallback*)mDisplayCallback,
mSource,
symbol,
NULL);
mSubscriptionList.push_back (sub);
if (++howMany % 1000 == 0)
{
printf ("Subscribed to %d subjects.\n", howMany);
}
}
示例3: subscribeToSymbols
void MamaSymbolListSubscriber::subscribeToSymbols ()
{
mQueueGroup = new MamaQueueGroup (mThreads, mBridgeImpl);
mSubscriptionCallback = new SubscriptionCallback (this);
vector<string>::iterator i;
for (i=mSubjectList.begin(); i != mSubjectList.end(); i++)
{
MamaSubscription* sub = NULL;
sub = new MamaSubscription;
string symbol = *(i);
sub->create (mTransport,
mQueueGroup->getNextQueue (),
(SubscriptionCallback*)mSubscriptionCallback,
mSourceName,
symbol.c_str(),
NULL);
mSubscriptionList.push_back (sub);
}
}