blpapi.TopicList
- class blpapi.TopicList
A list of topics which require creation.
Contains a list of topics which require creation.
Created from topic strings or from
TOPIC_SUBSCRIBED
orRESOLUTION_SUCCESS
messages. This is passed to acreateTopics()
call orcreateTopicsAsync()
call on aProviderSession
. It is updated and returned by thecreateTopics()
call.- CREATED = 1
- FAILURE = 2
- NOT_CREATED = 0
- __init__(original=None)
Create an empty
TopicList
, or aTopicList
based onoriginal
ResolutionList
.- Parameters
original (
ResolutionList
) – Original resolution list to use.- Raises
TypeError – If
original
is not an instance ofResolutionList
.
If
original
isNone
- create emptyTopicList
. Otherwise create aTopicList
fromoriginal
. In this caseoriginal
is used by handle, so if the caller modifies original resolution list after the call,TopicList
also changes because owns the same handle.
- add(topicOrMessage, correlationId=None)
Add the specified topic or topic from message to this
TopicList
.- Parameters
topicOrMessage (str or Message) – Topic string or message to create a topic from
correlationId (CorrelationId) – CorrelationId to associate with the topic
- Returns
0
on success or negative number on failure.- Return type
- Raises
TypeError – If
correlationId
is not an instance ofCorrelationId
.
If topic is passed as
topicOrMessage
, add the topic to this list, optionally specifying acorrelationId
. After a successful call toadd()
the status for this entry isNOT_CREATED
.If
Message
is passed astopicOrMessage
, add the topic contained in the specifiedtopicSubscribedMessage
orresolutionSuccessMessage
to this list, optionally specifying acorrelationId
. After a successful call toadd()
the status for this entry isNOT_CREATED
.
- correlationIdAt(index)
- destroy()
Destroy the handle using stored dtor
- message(correlationId)
- Parameters
correlationId (CorrelationId) – Correlation id associated with the message
- Returns
Message received during creation of the topic identified by the specified
correlationId
.- Return type
- Raises
Exception – If
correlationId
does not identify an entry in thisTopicList
or if the status of the entry identified bycorrelationId
is notCREATED
.
The message returned can be used when creating an instance of
Topic
.
- messageAt(index)
- Parameters
index (int) – Index of the entry
- Returns
- Message received during creation of the entry at
index
.
- Return type
- Raises
Exception – If
index >= size()
or if the status of the entry identify bycorrelationId
is notCREATED
.
The message returned can be used when creating an instance of
Topic
.
- status(correlationId)
- Parameters
correlationId (CorrelationId) – Correlation id associated with the entry
- Returns
Status of the entry in this list identified by the specified
correlationId
. This may beNOT_CREATED
,CREATED
andFAILURE
.- Return type
- Raises
Exception – If the
correlationId
does not identify an entry in this list.
- statusAt(index)
- topicString(correlationId)
- Parameters
correlationId (CorrelationId) – Correlation id associated with the topic.
- Returns
Topic of the entry identified by ‘correlationId’.
- Return type
- Raises
Exception – If the
correlationId
does not identify an entry in this list.