newspeoplefor developersdocumentationdownloads

nObject Class Reference
[Nebula Kernel]

#include <nobject.h>

Inheritance diagram for nObject:

nReferenced nSignalEmitter nRoot Receiver Emitter nAnimationServer nApplication nAppState nAudioServer3 nBuddyClient nBuddyCommandInterpreter nBuddyDatabase nBuddyServer nCaptureServer nCLODChunkerNode nCLODTQTMakerNode nCLODTQTSplatterNode nConServer nEnv nFileNode nFileServer2 nGfxServer2 nGuiServer nGuiSkin nGuiWidget nHttpServer nInputServer nLocaleServer nLuaTest nMap nNetClient nNetServer nOctree nOctVisitor nOpendeBody nOpendeGeom nOpendeJoint nOpendePickServer nOpendeServer nOpendeWorld nParticleServer nParticleServer2 nPersistServer nPrefServer nRemoteServer nResource nResourceLoader nResourceServer nSceneNode nSceneServer nScriptableAnimBuilder nScriptableMeshBuilder nScriptServer nSessionClient nSessionClientContext nSessionServer nSessionServerContext nShadowServer2 nSharedMemory nShdTunerApp nSignalServer nSignalTestEmitter nSignalTestReceiver nSpatialSector nSqlServer nTimeServer nToolkitServer nVariableServer nVideoPlayer nVideoServer nVideoServer2 ReceiverScript SimpleObject List of all members.

Detailed Description

Provides:
  • reference counting and tracking (through nReferenced)
  • Nebula RTTI, a class is identified by a string name

Rules for subclasses:

  • only the default constructor is allowed
  • never use new/delete (or variants like n_new/n_delete) with nObject objects
  • use nKernelServer::New() to create an object and the object's Release() method to destroy it

See also nObject Script Interface

(c) 2004 Vadim Macagon Refactored out of nRoot.

Definition at line 38 of file nobject.h.


Public Member Functions

 nObject ()
 constructor (DONT CALL DIRECTLY, USE nKernelServer::New() INSTEAD)
virtual bool SaveCmds (nPersistServer *ps)
 save object to persistent stream
virtual int GetInstanceSize () const
 get instance size
virtual bool SaveAs (const char *name)
 save object under different name
virtual nObjectClone (const char *unused=0)
 create new object as clone of this object
nClassGetClass () const
 get pointer to my class object
bool IsA (const nClass *) const
 return true if part of class hierarchy
bool IsA (const char *) const
 return true if part of class hierarchy
bool IsInstanceOf (const nClass *) const
 return true instance of class
bool IsInstanceOf (const char *) const
 return true instance of class
bool Dispatch (nCmd *)
 invoke nCmd on object
void GetCmdProtos (nHashList *)
 get cmdproto list from object

Static Public Attributes

static nKernelServerkernelServer
 pointer to kernel server

Protected Member Functions

virtual ~nObject ()
 destructor (DONT CALL DIRECTLY, USE Release() INSTEAD)
void SetClass (nClass *)
 set pointer to my class object

Protected Attributes

nClassinstanceClass

Friends

class nClass

Constructor & Destructor Documentation

nObject::nObject  ) 
 

constructor (DONT CALL DIRECTLY, USE nKernelServer::New() INSTEAD)

Definition at line 13 of file nobject_main.cc.

nObject::~nObject  )  [protected, virtual]
 

destructor (DONT CALL DIRECTLY, USE Release() INSTEAD)

Definition at line 22 of file nobject_main.cc.


Member Function Documentation

bool nObject::SaveCmds nPersistServer ps  )  [virtual]
 

save object to persistent stream

This method is usually derived by subclasses to write their peristent attributes to the file server.

Reimplemented in nGuiWidget, nEnv, nSwingShapeNode, nAbstractCameraNode, nAbstractShaderNode, nAnimator, nAttachmentNode, nBlendShapeAnimator, nBlendShapeNode, nCharacter3Node, nFloatAnimator, nIntAnimator, nLightNode, nLodNode, nMaterialNode, nMultiLayeredNode, nParticleShapeNode, nParticleShapeNode2, nSceneNode, nShaderAnimator, nShadowNode, nShadowSkinShapeNode, nShapeNode, nSkinAnimator, nSkinShapeNode, nSkyNode, nSubdivShapeNode, nTextureAnimator, nTransformAnimator, nTransformCurveAnimator, nTransformNode, nUvAnimator, nVectorAnimator, nCLODChunkerNode, nCLODShapeNode, nCLODTQTMakerNode, nCLODTQTSplatterNode, nTerrainGrassNode, nTerrainNode, nMap, nMapNode, nMapResourceLoader, nOpenALServer, nOpendeAMotorJoint, nOpendeBallJoint, nOpendeBody, nOpendeBoxGeom, nOpendeCapsuleGeom, nOpendeFixedJoint, nOpendeGeom, nOpendeHashSpace, nOpendeHinge2Joint, nOpendeHingeJoint, nOpendeJoint, nOpendePlaneGeom, nOpendeQuadTreeSpace, nOpendeRayGeom, nOpendeSliderJoint, nOpendeSpace, nOpendeSphereGeom, nOpendeTransformGeom, nOpendeTriMeshGeom, nOpendeUniversalJoint, nOpendeWorld, nScriptableSector, SimpleObject, and nShdTunerApp.

Definition at line 124 of file nobject_main.cc.

int nObject::GetInstanceSize  )  const [virtual]
 

get instance size

Get byte size of this instance. For more accuracy, subclasses should add the size of allocated memory.

Definition at line 135 of file nobject_main.cc.

bool nObject::SaveAs const char *  name  )  [virtual]
 

save object under different name

Reimplemented in nRoot.

Definition at line 71 of file nobject_main.cc.

nObject * nObject::Clone const char *  unused = 0  )  [virtual]
 

create new object as clone of this object

Reimplemented in nRoot.

Definition at line 95 of file nobject_main.cc.

nClass * nObject::GetClass  )  const [inline]
 

get pointer to my class object

Definition at line 98 of file nobject.h.

bool nObject::IsA const nClass  )  const [inline]
 

return true if part of class hierarchy

Definition at line 108 of file nobject.h.

bool nObject::IsA const char *   )  const
 

return true if part of class hierarchy

Definition at line 147 of file nobject_main.cc.

bool nObject::IsInstanceOf const nClass  )  const [inline]
 

return true instance of class

Definition at line 126 of file nobject.h.

bool nObject::IsInstanceOf const char *   )  const
 

return true instance of class

Definition at line 157 of file nobject_main.cc.

bool nObject::Dispatch nCmd  ) 
 

invoke nCmd on object

Definition at line 31 of file nobject_main.cc.

void nObject::GetCmdProtos nHashList  ) 
 

get cmdproto list from object

Definition at line 44 of file nobject_main.cc.

void nObject::SetClass nClass  )  [inline, protected]
 

set pointer to my class object

Definition at line 88 of file nobject.h.


Friends And Related Function Documentation

friend class nClass [friend]
 

Definition at line 73 of file nobject.h.


Member Data Documentation

nKernelServer* nObject::kernelServer [static]
 

pointer to kernel server

Definition at line 70 of file nobject.h.

nClass* nObject::instanceClass [protected]
 

Definition at line 80 of file nobject.h.


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

Copyright © 1999-2005 by the contributing authors. Ideas, requests, problems: Send feedback.