ZFFramework
 
Loading...
Searching...
No Matches
ZFClass.h File Reference

meta data for ZFObject More...

#include "zfautoFwd.h"
#include "ZFObjectObserver.h"

Go to the source code of this file.

Classes

class  ZFClassInstanceObserverAddParam
 see ZFClass::instanceObserverAdd More...
 
class  ZFClass
 ZFObject's class info. More...
 

Namespaces

namespace  ZFGlobalEvent
 

 

Macros

#define ZFObjectTagKeyword_newInstanceGenericFailed
 used to mark object allocation failed for ZFClass::newInstanceGenericCheck
 
#define ZFClassDataUpdateObserver()
 see ZFGlobalEvent::E_ClassDataUpdate
 
#define ZFCoreCriticalClassNotTypeOf(cls, desired)
 log that likes "[file function (line)] class xxx not type of xxx"
 
#define ZFCoreCriticalClassNotTypeOfDetail(callerInfo, cls, desired)
 see ZFCoreCriticalClassNotTypeOf
 

Functions

void ZFClassGetAllT (ZFCoreArray< const ZFClass * > &ret)
 see ZFClassGetAll
 
ZFCoreArray< const ZFClass * > ZFClassGetAll (void)
 get all class currently registered, for debug use only
 
zfidentity ZFGlobalEvent::E_ClassDataUpdate (void)
 see ZFObject::observerNotify
 
void ZFClassAlias (const ZFClass *cls, const zfstring &aliasNameFull)
 alias class to a new name
 
void ZFClassAliasRemove (const ZFClass *cls, const zfstring &aliasNameFull)
 see ZFClassAlias
 

Detailed Description

meta data for ZFObject

Macro Definition Documentation

◆ ZFObjectTagKeyword_newInstanceGenericFailed

#define ZFObjectTagKeyword_newInstanceGenericFailed

used to mark object allocation failed for ZFClass::newInstanceGenericCheck

when object created by ZFClass::newInstanceGenericBegin, it's possible to have mismatch param for generic invoke of objectOnInit, you may set an error message to the allocated object by ZFObject::objectTag with this as key and the error message (v_zfstring) as value, to tell ZFClass::newInstanceGenericCheck that the allocation failed

◆ ZFClassDataUpdateObserver

#define ZFClassDataUpdateObserver ( )

see ZFGlobalEvent::E_ClassDataUpdate

Warning
app code can add observer to this event, but must not manually notify this event
also, take care of performance

Function Documentation

◆ ZFClassAlias()

void ZFClassAlias ( const ZFClass * cls,
const zfstring & aliasNameFull )
extern

alias class to a new name

class alias only affects reflection, typically used for script binding
you can alias more than one name to same class, all of the aliased class points to same original ZFClass

// the aliased class is exactly same of the original,
// so the reflected class name still prints "ZFObject"
void ZFClassAlias(const ZFClass *cls, const zfstring &aliasNameFull)
alias class to a new name
#define ZFLogTrim(...)
see ZFLog
Definition ZFLog.h:80
static const ZFClass * classForName(const zfstring &classNameOrFullName)
get class info by name
const zfstring & className(void) const
class name, e.g. "ZFObject"
Definition ZFClass.h:181
static const ZFClass * ClassData(void)
get class info
Definition ZFObjectCore.h:211
See also
ZFMethodAlias