PeerPublisher         PeerOS - Class responsible for creating the PeerOS message instances and pushing them out to subscribed readers
Print

Purpose

This is the class responsible for creating the PeerOS message instances and pushing them out to subscribed readers. It answers, "Who will be Publishing this message?"

Implementation

Your custom publisher class should always inherit from PeerPublisher. Here is a very simple one which publishes a messge with no modification to that message:

class CMPublish_Keyboard:
        public PeerPublisher,
        public ImaginaryCEGUIInputLibrary
  {
  public:
      CMPublish_Keyboard(void) : PeerPublisher() { }
      virtual int Publish(PeerMessage &_pas)
      {
          std::cout   << "KeyboardPublisher::Publish(" << _pas.m_topic << ", " << _pas.m_subtopic << ")\n"
          return PeerPublisher::Publish(_pas);
      }
  };

 

Use

PeerPublisher is used in the Vitrius project, which is not documented on the Ogre3D wiki. However, the class names and examples may help you in deciding how to implement PeerOS in your project:

  • CMPublish_Keyboard: Wraps Ogre::KeyListener events with CM_Keyboard and publishes them.
  • CMXLate_Hub: Is both a handler ("reader") and a publisher. Reads from several sources (keyboard, joystick, network, etc). Will publish to several others, but for now only publishes CM_Application messages.

 


Contributors to this page: jacmoe111451 points  and OgreWikiBot .
Page last modified on Sunday 03 of January, 2010 00:40:32 GMT by jacmoe111451 points .


The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.