NAP
Object Class Reference

#include <rtti/object.h>

Public Member Functions

 Object ()
 
virtual ~Object ()
 
virtual bool init (utility::ErrorState &errorState)
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Static Public Member Functions

static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Public Attributes

std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Detailed Description

Base class of all top-level objects that support serialization / de-serialization.

Derive from this object if your object:

  • needs to be serialized to the root of the document.
  • needs to be able to be pointed to from other objects.

If you're making, for example, a compound (i.e a plain struct) there is no need to derive from this class.

Inheritance diagram for Object:
[legend]

Constructor & Destructor Documentation

◆ Object() [1/3]

Object ( )

◆ ~Object()

virtual ~Object ( )
virtual

◆ Object() [2/3]

Object ( Object )
delete

Copy is not allowed

◆ Object() [3/3]

Object ( Object &&  )
delete

Move is not allowed

Member Function Documentation

◆ init()

virtual bool init ( utility::ErrorState errorState)
virtual

Override this method to initialize the object after de-serialization. When called it is safe to assume that all dependencies have been resolved up to this point.

Parameters
errorStateshould contain the error message when initialization fails.
Returns
if initialization succeeded or failed.

Reimplemented in BitmapFromFile, Video, Mesh, TriangleLine, Material, Hexagon, Circle, Rectangle, Line, WebSocketClient, SerialPort, APIWebSocketServer, WebSocketServerEndPoint, ComponentInstance, CameraControllerInstance, OrthoCameraComponentInstance, RenderableMeshComponentInstance, WebSocketServer, PythonScriptComponentInstance, Font, APIWebSocketClient, PlaybackComponentInstance, Bitmap, RotateComponentInstance, RenderToTextureComponentInstance, TransformComponentInstance, OSCInputComponentInstance, Renderable2DTextComponentInstance, Renderable3DTextComponentInstance, APIComponentInstance, OrbitControllerInstance, FirstPersonControllerInstance, RenderableTextComponentInstance, LevelMeterComponentInstance, OrthoControllerInstance, WebSocketComponentInstance, OutputComponentInstance, PerspCameraComponentInstance, IWebSocketClient, Scene, AudioInputComponentInstance, AudioComponentInstance, VideoAudioComponentInstance, MidiInputComponentInstance, PythonScriptComponent, WebSocketClientEndPoint, WebSocketInterface, RenderWindow, LineFromFile, PolyLine, RenderTarget, PythonScript, RenderTexture2D, VisualizeNormalsMesh, IWebSocketServer, ImageFromFile, BoxMesh, WebSocketTicket, AudioFileResource, PlaneMesh, ScatterPointsMesh, Shader, MeshFromFile, and SphereMesh.

◆ isIDProperty()

static bool isIDProperty ( rtti::Instance object,
const rtti::Property property 
)
static
Returns
if this is an object that holds a valid identifier attribute

◆ onDestroy()

virtual void onDestroy ( )
virtual

This function is called on destruction and is only invoked after a successful call to init(). If initialization fails onDestroy will not be invoked. Objects are destroyed in reverse init order. It is safe to assume that when onDestroy is called all your pointers are valid. This function is also called when editing JSON files. If during the real-time edit stage an error occurs, every object that initialized successfully will be destroyed in the correct order.

Reimplemented in APIWebSocketServer, WebSocketServer, EntityInstance, IWebSocketClient, and Scene.

◆ operator=() [1/2]

Object& operator= ( const Object )
delete

Copy assignment is not allowed

◆ operator=() [2/2]

Object& operator= ( Object &&  )
delete

Move assignment is not allowed

Member Data Documentation

◆ mID

std::string mID

Property: 'mID' unique name of the object. Used as an identifier by the system.