OpenBlox
A game engine which provides a simple and easy to learn Lua API.
OB::ClassMetadata Class Referenceabstract

#include <ClassMetadata.h>

Public Member Functions

virtual shared_ptr< Instance::InstancenewInstance (OBEngine *eng)=0
 
virtual bool isA (shared_ptr< Instance::Instance > obj)=0
 
virtual bool isInstantiatable ()=0
 
virtual bool isService (bool isDataModel)=0
 
virtual std::string getClassName ()=0
 
virtual std::string getParentClassName ()=0
 
virtual InstanceInitFnc getInitFunc ()=0
 

Member Function Documentation

◆ getClassName()

virtual std::string OB::ClassMetadata::getClassName ( )
pure virtual

Returns the name of the class this ClassMetadata describes.

Returns
Name of the class described by this ClassMetadata
Author
John M. Harris, Jr.

◆ getInitFunc()

virtual InstanceInitFnc OB::ClassMetadata::getInitFunc ( )
pure virtual

Used to initialize Lua metatables for classes, among other things.

Author
John M. Harris, Jr.

◆ getParentClassName()

virtual std::string OB::ClassMetadata::getParentClassName ( )
pure virtual

Returns the parent class name of the class this ClassMetadata describes. For Instance itself, this is "", that should not be true of any other Instance, or “bad things” will happen.

Returns
Parent class name
Author
John M. Harris, Jr.

◆ isA()

virtual bool OB::ClassMetadata::isA ( shared_ptr< Instance::Instance obj)
pure virtual

Used to tell if the supplied OB::Instance::Instance* is of the class described by this ClassMetadata instance.

Parameters
objInstance to test against this type
Returns
true if obj is an instance of the defined class
Author
John M. Harris, Jr.

◆ isInstantiatable()

virtual bool OB::ClassMetadata::isInstantiatable ( )
pure virtual

Used to tell if the class described by this ClassMetadata can be created.

Returns
true if this class can be created. Doesn't apply to services or replication. Replication bypasses this entirely.

◆ isService()

virtual bool OB::ClassMetadata::isService ( bool  isDataModel)
pure virtual

Returns true if the class described is a service, passes isDataModel for DataModel-only services.

Parameters
isDataModelWhether or not this is being called from the DataModel
Returns
true if this is a service, otherwise false.
Author
John M. Harris, Jr.

◆ newInstance()

virtual shared_ptr<Instance::Instance> OB::ClassMetadata::newInstance ( OBEngine eng)
pure virtual

Used by the ClassFactory to create new instances of the class described by this ClassMetadata instance.

Returns
New Instance or NULL if the class this describes is abstract.
Author
John M. Harris, Jr.

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