C
Christopher
How can I ... let's see if I can word this right... provide a
comparator to be determined by the client of my library, to a class in
my library for the use of ordering objects in a container?
I want to modify this source, to allow the user of the class to give
me thier own comparator at construction time:
#ifndef RENDERQUEUE_H
#define RENDERQUEUE_H
// EngineX Includes
#include "IRenderable.h"
// Standard Includes
#include <vector>
//------------------------------------------------------------------------------
class RenderQueue
{
public:
/**
*
**/
RenderQueue();
/**
*
**/
~RenderQueue();
/**
* Inserts a renderable object into the render queue
**/
void Insert(IRenderable * object);
/**
* Removes a renderable object off the queue
**/
void Remove(IRenderable * object);
protected:
/**
* Comparator
**/
struct Compare
{
bool operator () (const IRenderable * lhs, const IRenderable *
rhs);
};
/**
* Priotity Queue container
**/
typedef std::vector<IRenderable *> Queue;
Queue m_queue;
private:
};
#endif // RENDERQUEUE_H
comparator to be determined by the client of my library, to a class in
my library for the use of ordering objects in a container?
I want to modify this source, to allow the user of the class to give
me thier own comparator at construction time:
#ifndef RENDERQUEUE_H
#define RENDERQUEUE_H
// EngineX Includes
#include "IRenderable.h"
// Standard Includes
#include <vector>
//------------------------------------------------------------------------------
class RenderQueue
{
public:
/**
*
**/
RenderQueue();
/**
*
**/
~RenderQueue();
/**
* Inserts a renderable object into the render queue
**/
void Insert(IRenderable * object);
/**
* Removes a renderable object off the queue
**/
void Remove(IRenderable * object);
protected:
/**
* Comparator
**/
struct Compare
{
bool operator () (const IRenderable * lhs, const IRenderable *
rhs);
};
/**
* Priotity Queue container
**/
typedef std::vector<IRenderable *> Queue;
Queue m_queue;
private:
};
#endif // RENDERQUEUE_H