Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::ResourceIdentifier Class Referencefinal

An general identifier that points to some resource. This is the most general form of a resource identifier, typically refers to as Photon Resource Identifier (PRI) thoughout the engine. More...

#include <ResourceIdentifier.h>

Public Member Functions

 ResourceIdentifier ()
 Creates empty identifier that refers to nothing.
 
 ResourceIdentifier (std::string identifier)
 Creates identifier from a character sequence.
 
bool resolve (IResourceIdentifierResolver &resolver)
 Work out the resource the identifier points to.
 
bool isResolved () const
 Whether the target resource is identified.
 
bool hasIdentifier () const
 Whether there is an identifier. An identifier may not exist in the following situations:
 
const std::string & getIdentifier () const
 
Path getPath () const
 
std::string getString () const
 
void setPath (Path path)
 Directly set a path to resource. This will also clear any existing identifier as we cannot automatically choose one of the many types of identifiers that resolves to this path (many-to-one mapping).
 
bool isEmpty () const
 Whether any information is contained.
 
std::string toString () const
 

Friends

class IResourceIdentifierResolver
 

Detailed Description

An general identifier that points to some resource. This is the most general form of a resource identifier, typically refers to as Photon Resource Identifier (PRI) thoughout the engine.

Constructor & Destructor Documentation

◆ ResourceIdentifier() [1/2]

ph::ResourceIdentifier::ResourceIdentifier ( )

Creates empty identifier that refers to nothing.

◆ ResourceIdentifier() [2/2]

ph::ResourceIdentifier::ResourceIdentifier ( std::string identifier)
explicit

Creates identifier from a character sequence.

Member Function Documentation

◆ getIdentifier()

const std::string & ph::ResourceIdentifier::getIdentifier ( ) const

◆ getPath()

Path ph::ResourceIdentifier::getPath ( ) const

◆ getString()

std::string ph::ResourceIdentifier::getString ( ) const

◆ hasIdentifier()

bool ph::ResourceIdentifier::hasIdentifier ( ) const

Whether there is an identifier. An identifier may not exist in the following situations:

  1. There was no identifier specified.
  2. A resolved target was set directly (see set methods for more details).

◆ isEmpty()

bool ph::ResourceIdentifier::isEmpty ( ) const

Whether any information is contained.

Returns
true if any identifier exists, be it unresolved or resolved; otherwise return false.

◆ isResolved()

bool ph::ResourceIdentifier::isResolved ( ) const

Whether the target resource is identified.

◆ resolve()

bool ph::ResourceIdentifier::resolve ( IResourceIdentifierResolver & resolver)

Work out the resource the identifier points to.

◆ setPath()

void ph::ResourceIdentifier::setPath ( Path path)

Directly set a path to resource. This will also clear any existing identifier as we cannot automatically choose one of the many types of identifiers that resolves to this path (many-to-one mapping).

◆ toString()

std::string ph::ResourceIdentifier::toString ( ) const

Friends And Related Symbol Documentation

◆ IResourceIdentifierResolver

friend class IResourceIdentifierResolver
friend

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