logog
logger optimized for games
Node Class Reference

#include <node.hpp>

+ Inheritance diagram for Node:

Public Member Functions

 Node ()
 
 ~Node ()
 
virtual void Initialize ()
 
virtual bool CanPublish () const
 
virtual bool CanSubscribe () const
 
virtual bool CanSubscribeTo (const Node &)
 
virtual bool IsTopic () const
 
virtual bool PublishTo (Node &subscriber)
 
virtual bool PublishToMultiple (LockableNodesType &nodes)
 
virtual bool UnpublishTo (Node &subscriber)
 
virtual bool UnpublishToMultiple (LockableNodesType &nodes)
 
virtual bool SubscribeTo (Node &publisher)
 
virtual bool SubscribeToMultiple (LockableNodesType &nodes)
 
virtual bool UnsubscribeTo (Node &publisher)
 
virtual bool UnsubscribeToMultiple (LockableNodesType &nodes)
 
void Clear ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
void * operator new (size_t nSize)
 
void * operator new[] (size_t nSize)
 
void operator delete (void *ptr)
 
void operator delete[] (void *ptr)
 

Public Attributes

void * m_pUserData1
 
void * m_pUserData2
 

Protected Attributes

LockableNodesType m_Subscribers
 
LockableNodesType m_Publishers
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static void * Allocate (size_t nSize)
 
static void Deallocate (void *ptr)
 

Constructor & Destructor Documentation

Node ( )

All nodes self-register as part of the all-nodes database.

~Node ( )

Member Function Documentation

virtual bool CanPublish ( ) const
virtual

Can a node send notifications? By default they can; later subclasses may not be able to.

Reimplemented in TopicSink.

virtual bool CanSubscribe ( ) const
virtual

Can a node receive notifications? By default they can; later subclasses may not be able to.

Reimplemented in TopicSource.

virtual bool CanSubscribeTo ( const Node )
virtual

Is this node interested in receiving notifications from another topic?

Reimplemented in Topic.

void Clear ( )
virtual void Initialize ( )
virtual

Call this function immediately after creating a node (or any of the children of the node class.) This function currently registers the node as part of the list of subscriber nodes, if this node may in fact subscribe. If this node is capable of subscribing at all, then this function registers this node as a possible subscriber. Doing this helps to keep down the number of nodes we search, when we are determining which nodes a new node might subscribe to. We have to do this registration as a second step, after the node is completely initialized, as subscriberness is determined late in initialization.

Reimplemented in TopicSink, and Socket.

virtual bool IsTopic ( ) const
virtual

In order to avoid bringing in a bunch of RTTI stuff, we permit nodes to be asked whether they're topics or not

Reimplemented in TopicSink, and Topic.

virtual bool PublishTo ( Node subscriber)
virtual

Causes this node to begin publishing events to the given subscriber.

Parameters
subscriberThe node to receive published events
Returns
true if the request was successful, false if the subscriber was already subscribed

Reimplemented in TopicSink, and Topic.

virtual bool PublishToMultiple ( LockableNodesType nodes)
virtual

Causes this node to attempt to publish to some other nodes.

virtual bool SubscribeTo ( Node publisher)
virtual

Causes this node to start receiving events from the given publisher.

Parameters
publisherThe node to start receiving events from
Returns
true if successful, false if the publisher was already subscribed

Reimplemented in TopicSource.

virtual bool SubscribeToMultiple ( LockableNodesType nodes)
virtual

Causes this node to attempt to subscribe to some other nodes.

virtual bool UnpublishTo ( Node subscriber)
virtual

Causes this node to stop publishing events to this subscriber.

Parameters
subscriberThe node to stop receiving events
Returns
true if successful, false if the subscriber was not being published to in the first place

Reimplemented in TopicSink.

virtual bool UnpublishToMultiple ( LockableNodesType nodes)
virtual

Causes this node to attempt to unpublish to some other nodes.

virtual bool UnsubscribeTo ( Node publisher)
virtual

Causes this node to unsubscribe from the given publisher's events.

Parameters
publisherThe publisher to unsubscribe from
Returns
true if successful, false if the node was already unsubscribed

Reimplemented in TopicSource.

virtual bool UnsubscribeToMultiple ( LockableNodesType nodes)
virtual

Causes this node to attempt to unsubscribe to some other nodes.

Member Data Documentation

LockableNodesType m_Publishers
protected

A bunch of nodes that this node interested in hearing from.

void* m_pUserData1

A pointer to any custom data you need to store for a node.

void* m_pUserData2

A pointer to any custom data you need to store for a node.

LockableNodesType m_Subscribers
protected

A bunch of nodes that are interested in what this node has to report.


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