CSEngine
Loading...
Searching...
No Matches
CSE::SObject Class Referenceabstract
Inheritance diagram for CSE::SObject:
CSE::SComponent CSE::SGameObject CSE::SResource CSE::Scene CSE::AnimatorComponent CSE::CameraComponent CSE::CustomComponent CSE::DrawableStaticMeshComponent CSE::JointComponent CSE::LightComponent CSE::RenderComponent CSE::TransformComponent CSE::SGameObjectFromSPrefab CSE::Animation CSE::GLProgramHandle CSE::SFrameBuffer CSE::SISurface CSE::SMaterial CSE::SPrefab CSE::SScriptObject CSE::SShaderGroup CSE::STexture CSE::Skeleton CSE::SScene FirstDemoScene WebDemoScene

Public Member Functions

 SObject (bool isRegister)
 
virtual void Exterminate ()=0
 
virtual void SetUndestroyable (bool enable)
 
virtual void Destroy ()
 
virtual void __FORCE_DESTROY__ ()
 
virtual std::string GenerateMeta ()
 
std::string GetHash () const
 
virtual void SetHash (std::string &hash)
 

Protected Attributes

std::string m_hash
 

Friends

class MemoryMgr
 

Detailed Description

Definition at line 7 of file SObject.h.

Constructor & Destructor Documentation

◆ SObject() [1/2]

SObject::SObject ( )

Definition at line 11 of file SObject.cpp.

11 {
12 memoryMgr = CORE->GetCore(MemoryMgr);
13 GenerateHashString();
14 // register this object to MemoryContainer class
15 memoryMgr->Register(this);
16}

◆ SObject() [2/2]

SObject::SObject ( bool  isRegister)
explicit

Definition at line 18 of file SObject.cpp.

18 {
19 GenerateHashString();
20 if(isRegister) memoryMgr->Register(this);
21}

Member Function Documentation

◆ __FORCE_DESTROY__()

void SObject::__FORCE_DESTROY__ ( )
virtual

Definition at line 35 of file SObject.cpp.

35 {
36 memoryMgr->ReleaseObject(this, true);
37}

◆ Destroy()

void SObject::Destroy ( )
virtual

Reimplemented in CSE::SGameObject.

Definition at line 30 of file SObject.cpp.

30 {
31 memoryMgr->ReleaseObject(this);
32
33}

◆ GenerateMeta()

std::string SObject::GenerateMeta ( )
virtual

Definition at line 39 of file SObject.cpp.

39 {
40 return nullptr;
41}

◆ GetHash()

std::string CSE::SObject::GetHash ( ) const
inline

Definition at line 25 of file SObject.h.

25 {
26 return m_hash;
27 }

◆ SetHash()

void SObject::SetHash ( std::string &  hash)
virtual

Definition at line 56 of file SObject.cpp.

56 {
57 const std::string prevHash = std::string(m_hash);
58 if(hash.empty()) {
59 GenerateHashString();
60 memoryMgr->ChangeHash(prevHash, m_hash);
61 return;
62 }
63 m_hash = hash;
64 memoryMgr->ChangeHash(prevHash, hash);
65}

◆ SetUndestroyable()

void SObject::SetUndestroyable ( bool  enable)
virtual

Definition at line 26 of file SObject.cpp.

26 {
27 isUndestroyable = enable;
28}

Friends And Related Symbol Documentation

◆ MemoryMgr

friend class MemoryMgr
friend

Definition at line 41 of file SObject.h.

Member Data Documentation

◆ m_hash

std::string CSE::SObject::m_hash
protected

Definition at line 38 of file SObject.h.


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