Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Utility::DebugParser Class Reference

Class for debug parser. More...

#include <debug_parser.h>

Inheritance diagram for Utility::DebugParser:
Events::Subject Events::Observer

Public Member Functions

void onNotifyNow (std::shared_ptr< Events::Event > event)
 When receiving an event that is immediate, onNotifyNow is used. It acts as an interrupt to make sure the object is notified before another engine loop. This is pure virtual and is implemented on a case by case basis in derived classes. More...
 
void handleQueuedEvent (std::shared_ptr< Events::Event > event)
 HandleQueuedEvent allows derived classes to define behaviour for when queuedEvents are received. More...
 
 DebugParser ()=default
 DebugParser constructor. More...
 
void parseCommand (const std::string &command)
 Parses a debug command. More...
 
void handleEvents ()
 Handles queued debug parser events. More...
 
virtual ~DebugParser ()=default
 Destroys the object. More...
 
- Public Member Functions inherited from Events::Subject
virtual ~Subject ()=default
 
virtual void notify (std::shared_ptr< Event > event)
 notify is used to tell observers of an event. More...
 
virtual void notifyNow (std::shared_ptr< Event > event)
 notifyNow is used to tell observers of an event as an interrupt. More...
 
virtual void addObserver (std::shared_ptr< Observer > observer)
 Adds an observer. More...
 
virtual void removeObserver (std::shared_ptr< Observer > observer)
 Removes an observer. More...
 
- Public Member Functions inherited from Events::Observer
virtual ~Observer ()
 
void onNotify (std::shared_ptr< Event > event)
 When receiving an event that is non-immediate, onNotify is used. The event is added to the event queue that is processed when processEventQueue is called. More...
 
void processEventQueue ()
 This should be called once ever loop for every Observer to properly use queued events. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Events::Observer
std::shared_ptr< EventgetEvent ()
 
bool eventsWaiting () const noexcept
 

Detailed Description

Class for debug parser.

Constructor & Destructor Documentation

Utility::DebugParser::DebugParser ( )
default

DebugParser constructor.

virtual Utility::DebugParser::~DebugParser ( )
virtualdefault

Destroys the object.

Member Function Documentation

void Utility::DebugParser::handleEvents ( )

Handles queued debug parser events.

Must be called every engine loop to get events out of the event queue and use them

References Events::Observer::processEventQueue().

Referenced by generated::getDebugParserModule().

void Utility::DebugParser::handleQueuedEvent ( std::shared_ptr< Events::Event event)
virtual

HandleQueuedEvent allows derived classes to define behaviour for when queuedEvents are received.

Parameters
[in]eventThe event

Implements Events::Observer.

References Events::DEBUG_COMMAND, and parseCommand().

Referenced by onNotifyNow().

void Utility::DebugParser::onNotifyNow ( std::shared_ptr< Events::Event event)
virtual

When receiving an event that is immediate, onNotifyNow is used. It acts as an interrupt to make sure the object is notified before another engine loop. This is pure virtual and is implemented on a case by case basis in derived classes.

Parameters
[in]eventThe event

Implements Events::Observer.

References handleQueuedEvent().


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