SML::AUTOCLASS_NOALLOC_T< _TYPE > Class Template Reference

A Template class of SML::AUTOCLASS. More...

#include <sml/class.h>

Inheritance diagram for SML::AUTOCLASS_NOALLOC_T< _TYPE >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef void(_TYPE::* VOIDMETHOD )()

Public Member Functions

 AUTOCLASS_NOALLOC_T (void(*SetupFunc)(), CONTEXTTYPE ContextTypesToAllow, CONTEXTTYPE ContextTypesToDisallow=CONTEXTTYPE_NONE)
 AUTOCLASS_NOALLOC_T (void(*SetupFunc)())
void AddMethod (const char *name, SMLFUNCSIG sig, void(_TYPE::*func)(), PARM *parms, int CreateDate=0, int ModDate=0, const char *ClassName=0, bool bInWin32Native=true, bool bInX=true, bool bRequired=false)

Detailed Description

template<class _TYPE>
class SML::AUTOCLASS_NOALLOC_T< _TYPE >

A Template class of SML::AUTOCLASS.

See documentation on SML::AUTOCLASS Use this template for classes which are pure-virtual base classes which cannot be allocated with new and delete, and which cannot actually be allocated at all. You can also use this class and provide your own ctor, dtor and copy constructor


Member Typedef Documentation

template<class _TYPE >
typedef void(_TYPE::* SML::AUTOCLASS_NOALLOC_T< _TYPE >::VOIDMETHOD)()

Constructor & Destructor Documentation

template<class _TYPE >
SML::AUTOCLASS_NOALLOC_T< _TYPE >::AUTOCLASS_NOALLOC_T ( void(*)()  SetupFunc  )  [inline]

Constructor.

Every SML::AUTOCLASS should have one static instance. When this instance is constructed, it registers the class so that any SML::CONTEXT created will know about it.

Parameters:
SetupFunc Function to call to setup this class. Normally a static method of the class we're representing
template<class _TYPE >
SML::AUTOCLASS_NOALLOC_T< _TYPE >::AUTOCLASS_NOALLOC_T ( void(*)()  SetupFunc,
CONTEXTTYPE  ContextTypesToAllow,
CONTEXTTYPE  ContextTypesToDisallow = CONTEXTTYPE_NONE 
) [inline]

Constructor.

Every SML::AUTOCLASS should have one static instance. When this instance is constructed, it registers the class so that any SML::CONTEXT created will know about it.

Parameters:
ContextTypesToAllow Function to call to setup this class. Normally a static method of the class we're representing SML::CONTEXTTYPEs to install this class for
ContextTypesToDisallow CONTEXTTYPEs to NOT install this class for

Member Function Documentation

template<class _TYPE >
void SML::AUTOCLASS_NOALLOC_T< _TYPE >::AddMethod ( const char *  name,
SMLFUNCSIG  sig,
void(_TYPE::*)()  func,
PARM parms,
int  CreateDate = 0,
int  ModDate = 0,
const char *  ClassName = 0,
bool  bInWin32Native = true,
bool  bInX = true,
bool  bRequired = false 
) [inline]

Add a method.

This is the main bit of magic. It allows you to define a method and have SML use the C++ implementation directly rather than having to write a wrapper around it.

This can only be used for methods that take up to 3 parameters, and have no overloaded versions in C++. You also cannot use this to define a method with parameters that are optional in SML. (The C++ implementation can have optional parameters, but SML will always pass a value).

The sig parameter tells the return type and the actual C++ type of the parameters. The first letter indicates the return type and the following letters indicate the parameter types. Possible values are:

  • v - void (return type only)
  • b - bool
  • d - double
  • i - INT32
  • u - UINT32
  • pv - (void*) Note, can also be used for references
  • pva - (void*) Same as pv, but tells SML it needs to free the return value (only used as a return type)
  • U - (MIUNICODE*) If used as a return type, SML will free the string when it's done with it
  • cU - (const MIUNICODE*)
  • c - (char*) If used as a return type, SML will free the string when it's done with it
  • cc - (const char*)

NOTE: you can pass an MISTRING& by using pv in the SIG_ and STYPE_String in the SML::PARM array for the parameter.

Parameters:
name Name of the method
sig Example, SIG_v_i == function taking an int and returning nothing (void)
parms parameters for the method (can be NULL if no parms) Parameters. Number and kind must match signature or else...
CreateDate The date this method was added (YYYYMMDD format)
ModDate The date this method was changed (0 if not changed since added)
ClassName Name of return class (if returning a class pointer)
bInWin32Native Set to false if method not available in WIN32_NATIVE code
bInX Set to false if method not available in X_NATIVE code
bRequired Set to true to mark method as required

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

Generated on Sun Oct 7 21:39:06 2012 for TNTsdk 2012 by  doxygen 1.6.1