SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
ScreenLogCommandPool Class Reference

Manages a pool of ScreenLogCommand objects for efficient reuse. More...

#include <ScreenLogCommandPool.h>

Public Member Functions

 ScreenLogCommandPool (const ScreenLogCommandPool &)=delete
 
ScreenLogCommandPooloperator= (const ScreenLogCommandPool &)=delete
 
ScreenLogCommandGetCommand (std::string str, SpriteFont *font, int x, int y)
 Retrieves a command from the pool or creates a new one if the pool is empty.
 
void ReturnCommand (ScreenLogCommand *cmd)
 Returns a ScreenLogCommand to the pool.
 

Private Attributes

std::queue< ScreenLogCommand * > commandPool
 Queue of available ScreenLogCommand objects for reuse.
 

Detailed Description

Manages a pool of ScreenLogCommand objects for efficient reuse.

The ScreenLogCommandPool class is responsible for managing a pool of ScreenLogCommand objects, allowing for efficient reuse of command objects to minimize memory allocation overhead.

Member Function Documentation

◆ GetCommand()

ScreenLogCommand * ScreenLogCommandPool::GetCommand ( std::string str,
SpriteFont * font,
int x,
int y )

Retrieves a command from the pool or creates a new one if the pool is empty.

Returns
A pointer to a ScreenLogCommand object.

◆ ReturnCommand()

void ScreenLogCommandPool::ReturnCommand ( ScreenLogCommand * cmd)

Returns a ScreenLogCommand to the pool.

Parameters
cmdPointer to the ScreenLogCommand to return.

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