Gorgon Game Engine
ObjectData Class Reference
Inheritance diagram for ObjectData:
[legend]

Public Member Functions

 ObjectData ()
 
 ObjectData (Base &v)
 
 ObjectData (Base *v)
 
 ObjectData (const std::string &name, Base &v)
 
 ObjectData (const std::string &name, Base *v)
 
virtual ~ObjectData ()
 
template<class T_ >
T_ & Get () const
 Returns the item contained within this object. More...
 
virtual GID::Type GetGID () const override
 Returns the Gorgon ID of this data object. More...
 
bool IsSet () const
 
BaseRelease ()
 Removes the object from this data without destroying it. More...
 
virtual void SaveValue (Writer &writer) const override
 Saves only the value of the data item to gorgon file. More...
 
void Set (Base &v)
 Changes the object that this data holds. Once set, the data owns the object. More...
 
void Set (Base *v)
 Changes the object that this data holds. Once set, the data owns the object. More...
 
virtual std::string ToString () const override
 Converts the contents of this data to string. More...
 
void Unset ()
 Removes the object that this data holds. More...
 
- Public Member Functions inherited from DataItem
virtual ~DataItem ()
 
template<class T_ >
T_ Get () const
 Returns the contents of this data item to the requested type; use GetObject in order to get resource objects. More...
 
template<>
int Get () const
 
template<>
float Get () const
 
template<class T_ >
T_ & GetObject () const
 
virtual void Save (Writer &writer) const
 Saves the data item with header information to gorgon file. More...
 

Static Public Member Functions

static DataItemLoad (std::weak_ptr< File > file, std::shared_ptr< Reader > reader, unsigned long totalsize)
 
- Static Public Member Functions inherited from DataItem
static void InitializeLoaders ()
 This function will initialize data loaders. More...
 

Additional Inherited Members

- Public Types inherited from DataItem
using LoaderFn = std::function< DataItem *(std::weak_ptr< File > file, std::shared_ptr< Reader > reader, unsigned long totalsize)>
 
- Public Attributes inherited from DataItem
std::string Name
 The name of the data item. More...
 
- Static Public Attributes inherited from DataItem
static std::map< GID::Type, LoaderFnDataLoaders
 Data loaders that all data containing classes would use to load their children. More...
 

Constructor & Destructor Documentation

◆ ObjectData() [1/5]

◆ ObjectData() [2/5]

ObjectData ( Base v)

◆ ObjectData() [3/5]

ObjectData ( const std::string &  name,
Base v 
)

References DataItem::Name.

◆ ObjectData() [4/5]

ObjectData ( Base v)

◆ ObjectData() [5/5]

ObjectData ( const std::string &  name,
Base v 
)

References DataItem::Name.

◆ ~ObjectData()

virtual ~ObjectData ( )
virtual

Member Function Documentation

◆ Get()

T_& Get ( ) const

Returns the item contained within this object.

◆ GetGID()

virtual GID::Type GetGID ( ) const
overridevirtual

Returns the Gorgon ID of this data object.

Implements DataItem.

References Gorgon::Resource::GID::Data_Object.

◆ IsSet()

bool IsSet ( ) const

◆ Load()

DataItem * Load ( std::weak_ptr< File file,
std::shared_ptr< Reader reader,
unsigned long  totalsize 
)
static

References ObjectData::ObjectData(), and ASSERT.

◆ Release()

Base& Release ( )

Removes the object from this data without destroying it.

◆ SaveValue()

virtual void SaveValue ( Writer writer) const
overridevirtual

Saves only the value of the data item to gorgon file.

issizewritten controls whether the size of the object should be written for some data types (like blob and string)

Implements DataItem.

References Base::Save().

◆ Set() [1/2]

void Set ( Base v)

Changes the object that this data holds. Once set, the data owns the object.

References Base::DeleteResource().

◆ Set() [2/2]

void Set ( Base v)

Changes the object that this data holds. Once set, the data owns the object.

References Base::DeleteResource().

◆ ToString()

virtual std::string ToString ( ) const
overridevirtual

Converts the contents of this data to string.

Implements DataItem.

References Base::GetName().

◆ Unset()

void Unset ( )

Removes the object that this data holds.

References Base::DeleteResource().


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