logog
logger optimized for games
Publisher-subscriber functionality

Topic objects are a base class that provides publisher-subscriber features to subclasses. Most classes in logog descend from the Topic class.

Topics are capable of sending other topics (or themselves) to other subscribers, as well as receiving another topic from a publisher. See Topic::Send() and Topic::Receive() for more details.

You can cause a Topic to send itself to its subscribers by calling Topic::Transmit().

Topics can publish, unpublish, subscribe and unsubscribe themselves from other topics. See Topic::Publish(), Topic::Unpublish(), Topic::Subscribe(), Topic::Unsubscribe() for more details.

Topics can also do all these tasks to lists of other topics. See Topic::PublishToMultiple(), Topic::UnpublishToMultiple(), Topic::SubscribeToMultiple(), Topic::UnsubscribeToMultiple().

{
Topic n1, n2;
// should succeed
if ( n1.SubscribeTo( n2 ) != true )
nResult++;
// should indicate no insertion took place
if ( n2.PublishTo( n1 ) != false )
nResult++;
n2.Transmit();
if ( n2.UnpublishTo( n1 ) != true )
nResult++;
if ( n1.UnsubscribeTo( n2 ) != false )
nResult++;
}