Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached Class Reference
Inheritance diagram for flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, topics={})
 
def disable_buffer (self, topic)
 
def enable_buffer (self, topic)
 
def get_from_buffer (self, topic)
 
def get_last_msg (self, topic)
 
def has_buffered (self, topic)
 
def has_msg (self, topic)
 
def has_topic (self, topic)
 
def is_available (self, topic)
 
def make_persistant (self, topic)
 
def remove_last_msg (self, topic, clear_buffer=False)
 
def set_callback (self, topic, callback)
 
def shutdown (self)
 
def subscribe (self, topic, msg_type, callback=None, buffered=False)
 
def unsubscribe_topic (self, topic)
 

Private Member Functions

def _callback (self, msg, topic)
 

Static Private Attributes

list _persistant_topics = []
 
dictionary _topics = {}
 

Detailed Description

A proxy for subscribing topics that caches and buffers received messages.

Definition at line 7 of file proxy_subscriber_cached.py.

Constructor & Destructor Documentation

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.__init__ (   self,
  topics = {} 
)
Initializes the proxy with optionally a given set of topics.

@type topics: dictionary string - message_class
@param topics: A dictionary containing a collection of topic - message type pairs.

Definition at line 14 of file proxy_subscriber_cached.py.

Member Function Documentation

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached._callback (   self,
  msg,
  topic 
)
private
Standard callback that is executed when a message is received.

@type topic: message
@param topic: The latest message received on this topic.

@type topic: string
@param topic: The topic to which this callback belongs.

Definition at line 49 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.disable_buffer (   self,
  topic 
)
Disables the buffer on the given topic.

@type topic: string
@param topic: The topic of interest.

Definition at line 86 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.enable_buffer (   self,
  topic 
)
Enables the buffer on the given topic.

@type topic: string
@param topic: The topic of interest.

Definition at line 77 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.get_from_buffer (   self,
  topic 
)
Pops the oldest buffered message of the given topic.

@type topic: string
@param topic: The topic of interest.

Definition at line 114 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.get_last_msg (   self,
  topic 
)
Returns the latest cached message of the given topic.

@type topic: string
@param topic: The topic of interest.

Definition at line 105 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.has_buffered (   self,
  topic 
)
Determines if the given topic has any messages in its buffer.

@type topic: string
@param topic: The topic of interest.

Definition at line 139 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.has_msg (   self,
  topic 
)
Determines if the given topic has a message in its cache.

@type topic: string
@param topic: The topic of interest.

Definition at line 130 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.has_topic (   self,
  topic 
)
Determines if the given topic is already subscribed.

@type topic: string
@param topic: The topic of interest.

Definition at line 175 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.is_available (   self,
  topic 
)
Checks if the subscriber on the given topic is available.

@type topic: string
@param topic: The topic of interest.

Definition at line 96 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.make_persistant (   self,
  topic 
)
Makes the given topic persistant which means messages can no longer be removed
(remove_last_msg will have no effect), only overwritten by a new message.

@type topic: string
@param topic: The topic of interest.

Definition at line 164 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.remove_last_msg (   self,
  topic,
  clear_buffer = False 
)
Removes the cached message of the given topic and optionally clears its buffer.

@type topic: string
@param topic: The topic of interest.

@type topic: boolean
@param topic: Set to true if the buffer of the given topic should be cleared as well.

Definition at line 148 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.set_callback (   self,
  topic,
  callback 
)
Adds the given callback to the topic subscriber.

@type topic: string
@param topic: The topic to add the callback to.

@type callback: function
@param callback: The callback to be added.

Definition at line 65 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.shutdown (   self)
Shuts this proxy down by unregistering all subscribers. 

Definition at line 196 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.subscribe (   self,
  topic,
  msg_type,
  callback = None,
  buffered = False 
)
Adds a new subscriber to the proxy.

@type topic: string
@param topic: The topic to subscribe.

@type msg_type: a message class
@param msg_type: The type of messages of this topic.

@type callback: function
@param callback: A function to be called when receiving messages.

@type buffered: boolean
@param buffered: True if all messages should be bufferd, False if only the last message should be cached.

Definition at line 24 of file proxy_subscriber_cached.py.

def flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached.unsubscribe_topic (   self,
  topic 
)
Removes the given topic from the list of subscribed topics.

@type topic: string
@param topic: The topic of interest.

Definition at line 185 of file proxy_subscriber_cached.py.

Member Data Documentation

list flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached._persistant_topics = []
staticprivate

Definition at line 12 of file proxy_subscriber_cached.py.

dictionary flexbe_core.proxy.proxy_subscriber_cached.ProxySubscriberCached._topics = {}
staticprivate

Definition at line 11 of file proxy_subscriber_cached.py.


The documentation for this class was generated from the following file:


flexbe_core
Author(s): Philipp Schillinger
autogenerated on Sun Dec 13 2020 04:01:39