 |
Gorgon Game Engine
|
Go to the documentation of this file.
3 #include "../Containers/Collection.h"
72 throw std::runtime_error(
"This object has no parent");
virtual void Resolve(File &file)
This function shall resolve links or similar constructs.
Definition: Base.cpp:6
bool DeleteResource()
Safely deletes the resource.
Definition: Base.cpp:34
void setparenttonullptr(Base &base)
Sets the parent of an object to nullptr, provides access.
Definition: Base.h:149
constexpr Type File
File.
Definition: GID.h:84
std::string name
Name of this resource object, may not be loaded.
Definition: Base.h:155
void destroychildren()
Destroys the children of this resource.
Definition: Base.cpp:43
virtual GID::Type GetGID() const =0
This function shall return Gorgon ID of this resource.
void New()
Generates a new GUID and assign that GUID to this one.
Definition: SGuid.h:113
bool IsEmpty() const
Returns whether this GUID is empty.
Definition: SGuid.h:158
virtual bool IsEqual(const SGuid &guid) const
This function tests whether this object has the given SGuid.
Definition: Base.h:49
const Containers::Collection< Base > & Children
The children this object have.
Definition: Base.h:131
const Base & GetRoot() const
Returns the root of this resource.
Definition: Base.h:85
Base()
Default constructor.
Definition: Base.cpp:28
bool IsAttached() const
Returns if this organizer is attached to a container.
Definition: Base.h:32
const Base * root
Root of this resource.
Definition: Base.h:165
virtual void Prepare()
This function shall prepare this resource to be used after resource is loaded.
Definition: Base.cpp:16
virtual void attachmentchanged()
Called when the attachment of the organizer is changed.
Definition: Base.h:50
const Containers::Collection< Base >::ConstIterator end() const
Allows easy iteration through range based fors.
Definition: Base.h:105
const Containers::Collection< Base >::ConstIterator begin() const
Allows easy iteration through range based fors.
Definition: Base.h:100
bool IsGood() const
Checks if the stream is open and it can be written to.
Definition: Writer.h:104
unsigned long refcount
INTERNAL, Reference count, used in linking mechanism.
Definition: Base.h:137
Base * parent
Immediate parent of this resource.
Definition: Base.h:158
virtual void SetName(const std::string &name)
Sets the name of the object.
Definition: Base.h:64
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
virtual void reorganize()=0
Should reorganize the contents of the organizer.
void Save(Writer &writer)
Saves this object into the given writer. The writer should be open prior to this call.
Definition: Base.cpp:57
Base * GetParentPtr() const
Returns the pointer to the parent. This function may return nullptr.
Definition: Base.h:78
#define ASSERT(expression, message,...)
Replaces regular assert to allow messages and backtrace.
Definition: Assert.h:161
Collection is a container for reference typed objects.
Definition: Collection.h:21
This class represents a logical resource file.
Definition: File.h:53
This class is the base for all Gorgon Resources.
Definition: Base.h:20
void RemoveFrom()
Removes the organizer from the container.
Definition: Base.cpp:17
virtual void save(Writer &writer) const =0
virtual void SetGuid(SGuid guid)
Changes the guid of the object.
Definition: Base.h:56
Const iterator allows iteration of const collections.
Definition: Collection.h:137
virtual void Discard()
This function shall discard any transitional data which is not vital after Prepare function is issued...
Definition: Base.cpp:22
This class allows resource objects to save their data to a stream.
Definition: Writer.h:59
void AttachTo(WidgetContainer &container)
Attaches this organizer to a container.
Definition: Base.cpp:6
const Containers::Collection< Base >::ConstIterator cbegin() const
Beginning of children.
Definition: Base.h:110
void Reorganize()
Reorganizes the widgets that are organized by this organizer.
Definition: Base.cpp:31
virtual SGuid GetGuid() const
Returns the guid of the object.
Definition: Base.h:53
bool HasParent() const
Returns whether this object has a parent.
Definition: Base.h:67
Type to store GID information.
Definition: GID.h:23
This class represents a short globally unique identifier.
Definition: SGuid.h:22
Containers::Collection< Base > children
Child objects that this resource object have.
Definition: Base.h:162
Base & GetParent() const
Returns the parent. If no parent set, this function throws std::runtime_error.
Definition: Base.h:70
const Containers::Collection< Base >::ConstIterator cend() const
End of children.
Definition: Base.h:115
const std::string & GetName() const
Returns the name of this object.
Definition: Base.h:61
virtual ~Base()
Destructor, Always children gets destroyed first.
Definition: Base.cpp:30
SGuid guid
SGuid to identify this resource object.
Definition: Base.h:152