Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cScriptableInterfaceDef Class Reference

#include <cScriptableInterface.h>

Inheritance diagram for GrayLib::cScriptableInterfaceDef:
Gray::CObject GrayLib::cScriptableInterfaceTemplate< GrayLib::cScriptContextObj > GrayLib::cScriptableInterfaceDynamic GrayLib::cScriptableInterfaceTemplate< TYPE >

Public Types

enum  P_TYPE_ { P_QTY }
 < if the InterfaceDef is itself an interface. More...
 

Public Member Functions

virtual cScriptableInterfaceDefPtr _stdcall get_ScriptInterfaceDef () const
 
 cScriptableInterfaceDef (const TYPEINFO_t &TypeInfo, const ATOMCHAR_t *pszName, cScriptableProp *pProps, cScriptableMethod *pMethods, cScriptableInterfaceDef *pSubInterface, const ATOMCHAR_t *pszHelp)
 
virtual ~cScriptableInterfaceDef ()
 
virtual bool isValidCheck () const noexcept
 < memory allocation and structure definitions are valid. More...
 
const ATOMCHAR_tget_Name () const noexcept
 
SCRIPTINTERFACEID_t get_InterfaceID () const noexcept
 
SCRIPTPROPID_t get_MethodQty () const noexcept
 
virtual cScriptableMethodGetMethodPtr (SCRIPTPROPID_t index) const noexcept
 
virtual SCRIPTPROPID_t GetMethodIndex (const cScriptableMethod *pMethod) const
 
SCRIPTPROPID_t FindMethodIndex (const ATOMCHAR_t *pszName) const
 
cScriptableMethodFindMethodPtrI (const ATOMCHAR_t *pszName) const
 
SCRIPTPROPID_t get_PropQty () const
 
virtual cScriptablePropGetPropPtr (SCRIPTPROPID_t index) const
 
virtual SCRIPTPROPID_t GetPropIndex (const cScriptableProp *pProp) const
 
SCRIPTPROPID_t FindPropIndex (const ATOMCHAR_t *pszName) const
 
cScriptablePropFindPropPtrI (const ATOMCHAR_t *pszName) const
 
bool SetMethodPrivLevel (const ATOMCHAR_t *pszMethod, PLEVEL_TYPE ePrivLevel)
 Adjust a privilege level for a method of this class. More...
 
bool IsInterfaceInit () const
 
HRESULT SerializeOutput (cStreamOutput &out, PLEVEL_TYPE ePrivLevel) const
 
virtual void InitScriptInterfaceDef ()
 
void InitSubInterfaces ()
 Manage all my sub-interfaces. More...
 
bool HasSubInterface (const cScriptableInterfaceDef *pInterfaceDef) const
 
bool HasInterface (const cScriptableInterfaceDef *pInterfaceDef) const
 
void AddSubInterfaceProps (cScriptableInterfaceDef *pInterface)
 
void AddSubInterfaces (cScriptableInterfaceDef *pSubInterface)
 search All sub classes as well. More...
 
const cScriptableMethodFindMethodStr (const ATOMCHAR_t *pszName) const
 
const cScriptablePropFindPropStr (const ATOMCHAR_t *pszName) const
 
const cScriptablePropFindPropOrMethodStr (const ATOMCHAR_t *pszName) const
 
const cScriptableMethodFindMethodHash (ATOMCODE_t nKey) const
 Find by string hash code. (assume no collisions) More...
 
const cScriptablePropFindPropHash (ATOMCODE_t nKey) const
 
- Public Member Functions inherited from Gray::CObject
virtual ~CObject ()
 
virtual void AssertValid () const
 < memory allocation and structure definitions are valid. More...
 
virtual void Serialize (cArchive &a)
 

Public Attributes

const TYPEINFO_tm_TypeInfo
 The C++ typeid(class type) this refers to. (we could derive m_pszName?) MUST HAVE RTTI on! More...
 
const ATOMCHAR_tm_pszName
 Interface Name. More...
 
cScriptableInterfaceDefm_pSubInterface
 primary sub class. (can actually be multi(m_aSubInterfacesAll) or none(nullptr)) More...
 
const char * m_pszHelp
 helpful description for human readers. More...
 
SCRIPTINTERFACEID_t m_nInterfaceID
 enum id to define the class. similar to XOBJTIDX_TYPE ? More...
 
cArraySortPtrName< const cScriptableProp, ATOMCHAR_tm_aPropsAll
 
cArraySortPtrName< const cScriptableMethod, ATOMCHAR_tm_aMethodsAll
 Complete list of all Methods. (includes sub class methods) More...
 
cArraySortPtrHash< const cScriptableProp, ATOMCODE_tm_aPropsAllHash
 We may search by hash code. More...
 
cArraySortPtrHash< const cScriptableMethod, ATOMCODE_tm_aMethodsAllHash
 
cArraySortVal< SCRIPTINTERFACEID_tm_aSubInterfacesAll
 List of interfaces I'm based on (Already added to m_aMethodsAll and m_aPropsAll. More...
 
UINT m_nInstances
 define get_ScriptInterfaceDef() More...
 

Static Public Attributes

static cScriptableProp sm_Props [P_QTY+1]
 
static cScriptableInterfaceDef sm_ScriptInterfaceDef
 

Protected Attributes

bool m_bInitInterface
 has this been synchronized with the base classes. More...
 
SCRIPTPROPID_t m_iPropQty
 get_PropQty() More...
 
SCRIPTPROPID_t m_iMethodQty
 get_MethodQty() More...
 

Detailed Description

Simple Interface Definition Description Metadata. Interface Definition plus

Note
This is typically fully created at static constructor time.

Member Enumeration Documentation

◆ P_TYPE_

< if the InterfaceDef is itself an interface.

Enumerator
P_QTY 

Constructor & Destructor Documentation

◆ cScriptableInterfaceDef()

GrayLib::cScriptableInterfaceDef::cScriptableInterfaceDef ( const TYPEINFO_t TypeInfo,
const ATOMCHAR_t pszName,
cScriptableProp pProps,
cScriptableMethod pMethods,
cScriptableInterfaceDef pSubInterface,
const ATOMCHAR_t pszHelp 
)

Define an interface. If base for cScriptableInterfaceDynamic, pszName = nullptr

◆ ~cScriptableInterfaceDef()

GrayLib::cScriptableInterfaceDef::~cScriptableInterfaceDef ( )
virtual

Member Function Documentation

◆ AddSubInterfaceProps()

void GrayLib::cScriptableInterfaceDef::AddSubInterfaceProps ( cScriptableInterfaceDef pInterface)
Note
This "sub" interface might be myself.

◆ AddSubInterfaces()

void GrayLib::cScriptableInterfaceDef::AddSubInterfaces ( cScriptableInterfaceDef pSubInterface)

search All sub classes as well.

Add a cScriptableInterfaceDef (and all its roots) to my props and methods

◆ FindMethodHash()

const cScriptableMethod * GrayLib::cScriptableInterfaceDef::FindMethodHash ( ATOMCODE_t  nKey) const

Find by string hash code. (assume no collisions)

◆ FindMethodIndex()

SCRIPTPROPID_t GrayLib::cScriptableInterfaceDef::FindMethodIndex ( const ATOMCHAR_t pszName) const
inline

◆ FindMethodPtrI()

cScriptableMethod* GrayLib::cScriptableInterfaceDef::FindMethodPtrI ( const ATOMCHAR_t pszName) const
inline

◆ FindMethodStr()

const cScriptableMethod * GrayLib::cScriptableInterfaceDef::FindMethodStr ( const ATOMCHAR_t pszName) const

◆ FindPropHash()

const cScriptableProp * GrayLib::cScriptableInterfaceDef::FindPropHash ( ATOMCODE_t  nKey) const

◆ FindPropIndex()

SCRIPTPROPID_t GrayLib::cScriptableInterfaceDef::FindPropIndex ( const ATOMCHAR_t pszName) const
inline

◆ FindPropOrMethodStr()

const cScriptableProp * GrayLib::cScriptableInterfaceDef::FindPropOrMethodStr ( const ATOMCHAR_t pszName) const

Find a prop or method of this class or it's subclasses. (by name)

Note
methods take precedence, Methods will override Props.

◆ FindPropPtrI()

cScriptableProp* GrayLib::cScriptableInterfaceDef::FindPropPtrI ( const ATOMCHAR_t pszName) const
inline

◆ FindPropStr()

const cScriptableProp * GrayLib::cScriptableInterfaceDef::FindPropStr ( const ATOMCHAR_t pszName) const

◆ get_InterfaceID()

SCRIPTINTERFACEID_t GrayLib::cScriptableInterfaceDef::get_InterfaceID ( ) const
inlinenoexcept

The interface enum id. This is only valid after cScriptableInterfaceMgr::Init()

◆ get_MethodQty()

SCRIPTPROPID_t GrayLib::cScriptableInterfaceDef::get_MethodQty ( ) const
inlinenoexcept

◆ get_Name()

const ATOMCHAR_t* GrayLib::cScriptableInterfaceDef::get_Name ( ) const
inlinenoexcept

◆ get_PropQty()

SCRIPTPROPID_t GrayLib::cScriptableInterfaceDef::get_PropQty ( ) const
inline

◆ get_ScriptInterfaceDef()

virtual cScriptableInterfaceDefPtr _stdcall GrayLib::cScriptableInterfaceDef::get_ScriptInterfaceDef ( ) const
inlinevirtual

◆ GetMethodIndex()

virtual SCRIPTPROPID_t GrayLib::cScriptableInterfaceDef::GetMethodIndex ( const cScriptableMethod pMethod) const
inlinevirtual

◆ GetMethodPtr()

virtual cScriptableMethod* GrayLib::cScriptableInterfaceDef::GetMethodPtr ( SCRIPTPROPID_t  index) const
inlinevirtualnoexcept

◆ GetPropIndex()

virtual SCRIPTPROPID_t GrayLib::cScriptableInterfaceDef::GetPropIndex ( const cScriptableProp pProp) const
inlinevirtual

◆ GetPropPtr()

virtual cScriptableProp* GrayLib::cScriptableInterfaceDef::GetPropPtr ( SCRIPTPROPID_t  index) const
inlinevirtual

"GetProp" has _WIN32 define.

Reimplemented in GrayLib::cScriptableInterfaceDynamic.

◆ HasInterface()

bool GrayLib::cScriptableInterfaceDef::HasInterface ( const cScriptableInterfaceDef pInterfaceDef) const

◆ HasSubInterface()

bool GrayLib::cScriptableInterfaceDef::HasSubInterface ( const cScriptableInterfaceDef pInterfaceDef) const

Is pInterfaceDef a sub interface of me ?

◆ InitScriptInterfaceDef()

void GrayLib::cScriptableInterfaceDef::InitScriptInterfaceDef ( )
virtual

things that cannot be done at static construct time. Such as attaching multiple base classes etc.

Just init the simple class.

Note
This is overridden by interfaces that have multiple sub interfaces.

Reimplemented in GrayLib::cScriptableInterfaceTemplate< TYPE >, GrayLib::cScriptableInterfaceTemplate< GrayLib::cScriptContextObj >, GrayLib::cScriptableInterfaceTemplate< TYPE >, and GrayLib::cScriptableInterfaceTemplate< GrayLib::cScriptContextObj >.

◆ InitSubInterfaces()

void GrayLib::cScriptableInterfaceDef::InitSubInterfaces ( )

Manage all my sub-interfaces.

Go through all my props and methods and make sure my list of sub interfaces is good. harmless if already called.

◆ IsInterfaceInit()

bool GrayLib::cScriptableInterfaceDef::IsInterfaceInit ( ) const
inline

◆ isValidCheck()

bool GrayLib::cScriptableInterfaceDef::isValidCheck ( ) const
virtualnoexcept

< memory allocation and structure definitions are valid.

NOT in MFC so use COBJECT_IsValidCheck to call.

Note
This can't be called in constructors and destructors of course !

Reimplemented from Gray::CObject.

◆ SerializeOutput()

HRESULT GrayLib::cScriptableInterfaceDef::SerializeOutput ( cStreamOutput out,
PLEVEL_TYPE  ePrivLevel 
) const

Send the interface definition out to a stream. base interface info. read by cScriptableInterfaceDynamic serialize the interace available to this ePrivLevel. i could read or write.

◆ SetMethodPrivLevel()

bool GrayLib::cScriptableInterfaceDef::SetMethodPrivLevel ( const ATOMCHAR_t pszMethod,
PLEVEL_TYPE  ePrivLevel 
)

Adjust a privilege level for a method of this class.

Set the Write/Exec privilege level for the method by name set privileges on props as well?

Member Data Documentation

◆ m_aMethodsAll

cArraySortPtrName<const cScriptableMethod, ATOMCHAR_t> GrayLib::cScriptableInterfaceDef::m_aMethodsAll

Complete list of all Methods. (includes sub class methods)

◆ m_aMethodsAllHash

cArraySortPtrHash<const cScriptableMethod, ATOMCODE_t> GrayLib::cScriptableInterfaceDef::m_aMethodsAllHash

◆ m_aPropsAll

cArraySortPtrName<const cScriptableProp, ATOMCHAR_t> GrayLib::cScriptableInterfaceDef::m_aPropsAll

High level names override low level names. Complete list of all Props. (includes sub class props)

◆ m_aPropsAllHash

cArraySortPtrHash<const cScriptableProp, ATOMCODE_t> GrayLib::cScriptableInterfaceDef::m_aPropsAllHash

We may search by hash code.

◆ m_aSubInterfacesAll

cArraySortVal<SCRIPTINTERFACEID_t> GrayLib::cScriptableInterfaceDef::m_aSubInterfacesAll

List of interfaces I'm based on (Already added to m_aMethodsAll and m_aPropsAll.

◆ m_bInitInterface

bool GrayLib::cScriptableInterfaceDef::m_bInitInterface
protected

has this been synchronized with the base classes.

◆ m_iMethodQty

SCRIPTPROPID_t GrayLib::cScriptableInterfaceDef::m_iMethodQty
protected

◆ m_iPropQty

SCRIPTPROPID_t GrayLib::cScriptableInterfaceDef::m_iPropQty
protected

◆ m_nInstances

UINT GrayLib::cScriptableInterfaceDef::m_nInstances

define get_ScriptInterfaceDef()

Qty of instances (objects) created of this interface type

◆ m_nInterfaceID

SCRIPTINTERFACEID_t GrayLib::cScriptableInterfaceDef::m_nInterfaceID

enum id to define the class. similar to XOBJTIDX_TYPE ?

◆ m_pSubInterface

cScriptableInterfaceDef* GrayLib::cScriptableInterfaceDef::m_pSubInterface

primary sub class. (can actually be multi(m_aSubInterfacesAll) or none(nullptr))

◆ m_pszHelp

const char* GrayLib::cScriptableInterfaceDef::m_pszHelp

helpful description for human readers.

◆ m_pszName

const ATOMCHAR_t* GrayLib::cScriptableInterfaceDef::m_pszName

Interface Name.

◆ m_TypeInfo

const TYPEINFO_t& GrayLib::cScriptableInterfaceDef::m_TypeInfo

The C++ typeid(class type) this refers to. (we could derive m_pszName?) MUST HAVE RTTI on!

◆ sm_Props

cScriptableProp GrayLib::cScriptableInterfaceDef::sm_Props
static
Initial value:
=
{
#define cScriptableInterfaceProp(a,b,c)
}
#define CSCRIPT_PROP_END
Definition: cScriptableInterface.h:264

◆ sm_ScriptInterfaceDef

cScriptableInterfaceDef GrayLib::cScriptableInterfaceDef::sm_ScriptInterfaceDef
static

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