Annwvyn::AnnScriptFile Class Reference

Ogre resource that contains the source code of a loaded .chai file. More...

#include <AnnScriptFile.hpp>

Inheritance diagram for Annwvyn::AnnScriptFile:
Collaboration diagram for Annwvyn::AnnScriptFile:

Public Member Functions

 AnnScriptFile (Ogre::ResourceManager *creator, const Ogre::String &name, Ogre::ResourceHandle handle, const Ogre::String &group, bool isManual=false, Ogre::ManualResourceLoader *loader=nullptr)
 Resource constructor. Called by the ResourceManager not by you. More...
 
virtual ~AnnScriptFile ()
 Destroy the resource object (will call unload()) More...
 
const std::stringgetSourceCode () const
 Get the loaded code. More...
 
void setLoadedSourceCode (const std::string &sourceCode)
 Set the source code. Intended to be used by the ResourceManager too. More...
 
void signalLoadedInChaiscript ()
 Set the loaded to true. More...
 
bool loadedInChaiscriptInterpretor () const
 Return if we are loaded. More...
 

Protected Member Functions

void loadImpl () override
 Load the file. More...
 
void unloadImpl () override
 Unload the file. More...
 
size_t calculateSize () const override
 Get the size of the file. More...
 

Private Attributes

std::string sourceCode
 Actual code of the file. More...
 
bool loadedByChaiScript
 Code evaluated on the chaiscript global scope. More...
 

Detailed Description

Ogre resource that contains the source code of a loaded .chai file.

Definition at line 12 of file AnnScriptFile.hpp.

Constructor & Destructor Documentation

◆ AnnScriptFile()

AnnScriptFile::AnnScriptFile ( Ogre::ResourceManager *  creator,
const Ogre::String &  name,
Ogre::ResourceHandle  handle,
const Ogre::String &  group,
bool  isManual = false,
Ogre::ManualResourceLoader *  loader = nullptr 
)

Resource constructor. Called by the ResourceManager not by you.

Definition at line 28 of file AnnScriptFile.cpp.

◆ ~AnnScriptFile()

AnnScriptFile::~AnnScriptFile ( )
virtual

Destroy the resource object (will call unload())

Definition at line 35 of file AnnScriptFile.cpp.

Member Function Documentation

◆ calculateSize()

size_t AnnScriptFile::calculateSize ( ) const
overrideprotected

Get the size of the file.

Definition at line 23 of file AnnScriptFile.cpp.

◆ getSourceCode()

const std::string & AnnScriptFile::getSourceCode ( ) const

Get the loaded code.

Definition at line 40 of file AnnScriptFile.cpp.

Here is the caller graph for this function:

◆ loadedInChaiscriptInterpretor()

bool AnnScriptFile::loadedInChaiscriptInterpretor ( ) const

Return if we are loaded.

Definition at line 55 of file AnnScriptFile.cpp.

◆ loadImpl()

void AnnScriptFile::loadImpl ( )
overrideprotected

Load the file.

Definition at line 11 of file AnnScriptFile.cpp.

Here is the call graph for this function:

◆ setLoadedSourceCode()

void AnnScriptFile::setLoadedSourceCode ( const std::string sourceCode)

Set the source code. Intended to be used by the ResourceManager too.

Definition at line 45 of file AnnScriptFile.cpp.

Here is the caller graph for this function:

◆ signalLoadedInChaiscript()

void AnnScriptFile::signalLoadedInChaiscript ( )

Set the loaded to true.

Definition at line 50 of file AnnScriptFile.cpp.

◆ unloadImpl()

void AnnScriptFile::unloadImpl ( )
overrideprotected

Unload the file.

Definition at line 18 of file AnnScriptFile.cpp.

Member Data Documentation

◆ loadedByChaiScript

bool Annwvyn::AnnScriptFile::loadedByChaiScript
private

Code evaluated on the chaiscript global scope.

Definition at line 18 of file AnnScriptFile.hpp.

◆ sourceCode

std::string Annwvyn::AnnScriptFile::sourceCode
private

Actual code of the file.

Definition at line 15 of file AnnScriptFile.hpp.


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