Design Pattern Examples
Overview of object-oriented design patterns
Message Struct Reference

Represents a message sent to the windows. A message contains a type and a position. More...

#include <HandlerChain_Message_Class.h>

Collaboration diagram for Message:
Collaboration graph

Public Member Functions

 Message (enum MessageType type, struct MessagePosition position)
 Constructor.
 
std::string ToString ()
 Convert this message to a string.
 

Public Attributes

enum MessageType MessageType
 Value from the MessageType enumeration indicating the type of this message.
 
MessagePosition Position
 Position of message when the message was sent. In a real system, this would generally represent the position of a cursor at the time the message was generated.
 

Detailed Description

Represents a message sent to the windows. A message contains a type and a position.

Definition at line 99 of file HandlerChain_Message_Class.h.

Constructor & Destructor Documentation

◆ Message()

Message ( enum MessageType  type,
struct MessagePosition  position 
)
inline

Constructor.

Parameters
typeValue from the MessageType enumeration indicating the type of message being created.
positionPosition of the message, expressed as a MessagePosition object.

Definition at line 120 of file HandlerChain_Message_Class.h.

Member Function Documentation

◆ ToString()

std::string ToString ( )
inline

Convert this message to a string.

Returns
Returns a string representation of this message.

Definition at line 130 of file HandlerChain_Message_Class.h.

References DesignPatternExamples_cpp::ButtonDown, DesignPatternExamples_cpp::ButtonUp, DesignPatternExamples_cpp::Close, Helpers::formatstring(), Message::Position, and MessagePosition::ToString().

Member Data Documentation

◆ MessageType

Value from the MessageType enumeration indicating the type of this message.

Definition at line 104 of file HandlerChain_Message_Class.h.

Referenced by MessageWindow::ProcessMessage(), and Message::ToString().

◆ Position

MessagePosition Position

Position of message when the message was sent. In a real system, this would generally represent the position of a cursor at the time the message was generated.

Definition at line 111 of file HandlerChain_Message_Class.h.

Referenced by MessageWindow::_HandleButtonDownMessage(), MessageWindow::_HandleButtonUpMessage(), and Message::ToString().


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