Coherent UI  2.5.3
A modern user interface library for games
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Coherent::UI::ResourceResponse Class Referenceabstract

Abstract interface for responding to read resource requests. More...

#include <Coherent/UI/FileHandler.h>

Public Member Functions

virtual void * GetBuffer (unsigned long size)=0
 Request buffer for resource data. More...
 
virtual void SignalSuccess ()=0
 Report that the resource is read successfully. More...
 
virtual void SignalFailure ()=0
 Report that resource reading has failed. More...
 
virtual void SetResponseHeader (const char *key, const char *value)=0
 Set a key-value pair in the response headers. More...
 
virtual void SetStatus (int status)=0
 Set the status for the response. More...
 

Detailed Description

Abstract interface for responding to read resource requests.

Member Function Documentation

virtual void* Coherent::UI::ResourceResponse::GetBuffer ( unsigned long  size)
pure virtual

Request buffer for resource data.

Warning
GetBuffer must be called only once.
Note
GetBuffer may be called in any thread.
Parameters
sizethe size of the resource
Returns
pointer to the beginning of the buffer. It may return nullptr when allocating the buffer has failed
virtual void Coherent::UI::ResourceResponse::SetResponseHeader ( const char *  key,
const char *  value 
)
pure virtual

Set a key-value pair in the response headers.

Parameters
keythe key for the response header
valuethe value for the response header
virtual void Coherent::UI::ResourceResponse::SetStatus ( int  status)
pure virtual

Set the status for the response.

Parameters
statusthe response status
virtual void Coherent::UI::ResourceResponse::SignalFailure ( )
pure virtual

Report that resource reading has failed.

Warning
This should be executed in the thread that all Coherent UI methods are executed.
After this method is called, any calls to any method of the instance are undefined behavior.
virtual void Coherent::UI::ResourceResponse::SignalSuccess ( )
pure virtual

Report that the resource is read successfully.

Warning
This should be executed in the thread that all Coherent UI methods are executed.
After this method is called, any calls to any method of the instance are undefined behavior.