SmartEngine  1.6.0
Public Member Functions | List of all members
SmartEngine::IResource Class Referenceabstract

Base class for objects that can be loaded from and saved to disk. More...

#include <Resource.h>

Inheritance diagram for SmartEngine::IResource:
SmartEngine::IObject SmartEngine::ISerializable SmartEngine::IObject SmartEngine::IAgentDataStore SmartEngine::ICuriosityModule SmartEngine::IGraph SmartEngine::ILossTrainer SmartEngine::IRLTrainer SmartEngine::IGeneticTrainer SmartEngine::IGradientDescentTrainer SmartEngine::IA2CTrainer SmartEngine::ID4PGTrainer SmartEngine::IPPOTrainer SmartEngine::IGeneticAgentTrainer

Public Member Functions

virtual const char * GetResourceName () const =0
 Returns the name of this resource passed to the constructor. More...
 
virtual SerializationResult GetLastLoadResult () const =0
 Returns the result of the last call to Load(). Useful for checking loaded data state after creation. More...
 
virtual SerializationResult Load (const char *appendName=nullptr)=0
 Load this object from disk. More...
 
virtual SerializationResult Save (const char *appendName=nullptr)=0
 Save this object to disk. More...
 
- Public Member Functions inherited from SmartEngine::IObject
virtual ObjectId GetId () const =0
 Returns the ID of this object. More...
 
virtual void AddRef () const =0
 Increments the internal reference count on this object. It is not common to use this method directly. More...
 
virtual void Release () const =0
 Decrements the internal reference count on this object. It is not common to use this method directly. More...
 
virtual int GetRefCount () const =0
 Returns the number of references to this object. More...
 
virtual void * QueryInterface (ObjectClassId id)=0
 Queries the object for an interface and returns a pointer to that interface if found. More...
 
void operator= (IObject const &x)=delete
 
- Public Member Functions inherited from SmartEngine::ISerializable
virtual SerializationResult Serialize (IMemoryBuffer *buffer)=0
 Write the contents of this object to a buffer. More...
 
virtual SerializationResult Deserialize (IMemoryBuffer *buffer)=0
 Fill this object with contents from a buffer. More...
 

Additional Inherited Members

- Public Attributes inherited from SmartEngine::IObject
 private
 
 __pad0__: IObject() {} IObject(IObject const&) = delete
 

Detailed Description

Base class for objects that can be loaded from and saved to disk.

When loading and saving, resources deal with one or more assets on disk. The name of the assets will be derived from the resource name used during the load / save process.

Member Function Documentation

◆ GetLastLoadResult()

virtual SerializationResult SmartEngine::IResource::GetLastLoadResult ( ) const
pure virtual

Returns the result of the last call to Load(). Useful for checking loaded data state after creation.

◆ GetResourceName()

virtual const char* SmartEngine::IResource::GetResourceName ( ) const
pure virtual

Returns the name of this resource passed to the constructor.

◆ Load()

virtual SerializationResult SmartEngine::IResource::Load ( const char *  appendName = nullptr)
pure virtual

Load this object from disk.

Parameters
appendNameOptional name to be appended to our resource name when loading. If not provided, the constructor's resource name will be the final resource name.

◆ Save()

virtual SerializationResult SmartEngine::IResource::Save ( const char *  appendName = nullptr)
pure virtual

Save this object to disk.

Parameters
appendNameOptional name to be appended to our resource name when saving. If not provided, the constructor's resource name will be the final resource name.