dynamicTypes.h
Engine/source/console/dynamicTypes.h
Support for legacy TorqueScript console types.
Classes:
class
class
Information about a console type.
class
Console Type Macros
define
_ConsoleBitfieldType(typeName, type, nativeType) type; \ ( type, nativeType ) \ class BitfieldConsoleType ## type : public \ { \ public: \ BitfieldConsoleType ## type() \ : ( sizeof( nativeType ), &type, #type ) \ { \ mTypeInfo = < nativeType >(); \ } \ virtual char *getTypeClassName() { return #typeName; } \ virtual *getNativeVariable() { return nativeType; } \ virtual deleteNativeVariable(* var) { nativeType* nativeVar = reinterpret_cast< nativeType* >( var ); delete nativeVar; }\ }; \ BitfieldConsoleType ## type gConsoleType ## type ## Instance;
define
_ConsoleEnumType(typeName, type, nativeType) type; \ ( type, nativeType ) \ class EnumConsoleType ## type : public \ { \ public: \ EnumConsoleType ## type() \ : ( sizeof( nativeType ), &type, #type ) \ { \ mTypeInfo = < nativeType >(); \ } \ virtual char *getTypeClassName() { return #typeName; } \ virtual *getNativeVariable() { return nativeType; } \ virtual deleteNativeVariable(* var) { nativeType* nativeVar = reinterpret_cast< nativeType* >( var ); delete nativeVar; }\ }; \ EnumConsoleType ## type gConsoleType ## type ## Instance;
define
ConsoleGetType(type) char *##type::getData( *dptr, *tbl, flag)
define
ConsolePrepType(typeName, type, nativeType) type; \ class ##type : public \ { \ public: \ typedef nativeType ; \ ##type() \ : ( sizeof( nativeType ), &type, #type ) \ { \ mTypeInfo = < nativeType >(); \ } \ virtual setData( *dptr, argc, char **argv, *tbl, flag); \ virtual char *getData( *dptr, *tbl, flag ); \ virtual char *getTypeClassName() { return #typeName ; } \ virtual *getNativeVariable() { * var = ; return (*)var; } \ virtual deleteNativeVariable(* var) { * nativeVar = reinterpret_cast<*>(var); delete nativeVar; } \ virtual char *prepData( char *data, char *buffer, bufferLen); \ }; \ ## type gConsoleType ## type ## Instance;
define
ConsoleProcessData(type) char *##type::prepData( char *data, char *buffer, bufferSz)
define
ConsoleSetType(type) ##type::setData( *dptr, argc, char **argv, *tbl, flag)
define
ConsoleType(typeName, type, nativeType, typePrefix) type; \ class ConsoleType##type : public \ { \ public: \ typedef nativeType ; \ ConsoleType##type() \ : ( sizeof( nativeType ), &type, #type ) \ { \ mTypeInfo = < nativeType >(); \ } \ virtual setData( *dptr, argc, char **argv, *tbl, flag); \ virtual char *getData( *dptr, *tbl, flag ); \ virtual char *getTypeClassName() { return #typeName ; } \ virtual *getNativeVariable() { * var = ; return (*)var; } \ virtual deleteNativeVariable(* var) { * nativeVar = reinterpret_cast<*>(var); delete nativeVar; } \ virtual getTypePrefix( ) { return ->insert( typePrefix ); } \ }; \ ConsoleType ## type gConsoleType ## type ## Instance;
define
ConsoleTypeFieldPrefix(type, typePrefix) ##type::getTypePrefix( ) { return ->insert( typePrefix ); }
define
DefineBitfieldType(type) ( type ); \ ( Type ## type, type );
define
DefineBitfieldType_R(type) ( type ); \ ( Type ## type, type );
define
DefineConsoleType(type, nativeType) extern type; \ extern char* castConsoleTypeToString( < nativeType >::ConstType &arg ); \ extern bool castConsoleTypeFromString( nativeType &arg, char *str ); \ template<> < nativeType >();
define
DefineEnumType(type) ( type ); \ ( Type ## type, type );
define
DefineEnumType_R(type) ( type ); \ ( Type ## type, type );
define
DefineUnmappedConsoleType(type, nativeType) ( type, nativeType ) \ template<> inline * < nativeType >() { return ; }
define
define
define
ImplementBitfieldType(type, doc) ( type, Type ## type, type ) \ ( type, type,, doc )
define
ImplementConsoleTypeCasters(type, nativeType) char *castConsoleTypeToString( < nativeType >::ConstType &arg ) { return (type, const_cast< nativeType* >( &arg ), 0); } \ bool castConsoleTypeFromString( nativeType &arg, char *str ) { (type, const_cast< nativeType* >( &arg ), 0, 1, &str); return true; } \ template<> < nativeType >() { return type; }
define
ImplementEnumType(type, doc) ( type, Type ## type, type ) \ ( type, type,, doc )
Public Functions
Detailed Description
Support for legacy TorqueScript console types.
Console Type Macros
_ConsoleBitfieldType(typeName, type, nativeType) type; \ ( type, nativeType ) \ class BitfieldConsoleType ## type : public \ { \ public: \ BitfieldConsoleType ## type() \ : ( sizeof( nativeType ), &type, #type ) \ { \ mTypeInfo = < nativeType >(); \ } \ virtual char *getTypeClassName() { return #typeName; } \ virtual *getNativeVariable() { return nativeType; } \ virtual deleteNativeVariable(* var) { nativeType* nativeVar = reinterpret_cast< nativeType* >( var ); delete nativeVar; }\ }; \ BitfieldConsoleType ## type gConsoleType ## type ## Instance;
_ConsoleEnumType(typeName, type, nativeType) type; \ ( type, nativeType ) \ class EnumConsoleType ## type : public \ { \ public: \ EnumConsoleType ## type() \ : ( sizeof( nativeType ), &type, #type ) \ { \ mTypeInfo = < nativeType >(); \ } \ virtual char *getTypeClassName() { return #typeName; } \ virtual *getNativeVariable() { return nativeType; } \ virtual deleteNativeVariable(* var) { nativeType* nativeVar = reinterpret_cast< nativeType* >( var ); delete nativeVar; }\ }; \ EnumConsoleType ## type gConsoleType ## type ## Instance;
ConsoleGetType(type) char *##type::getData( *dptr, *tbl, flag)
ConsolePrepType(typeName, type, nativeType) type; \ class ##type : public \ { \ public: \ typedef nativeType ; \ ##type() \ : ( sizeof( nativeType ), &type, #type ) \ { \ mTypeInfo = < nativeType >(); \ } \ virtual setData( *dptr, argc, char **argv, *tbl, flag); \ virtual char *getData( *dptr, *tbl, flag ); \ virtual char *getTypeClassName() { return #typeName ; } \ virtual *getNativeVariable() { * var = ; return (*)var; } \ virtual deleteNativeVariable(* var) { * nativeVar = reinterpret_cast<*>(var); delete nativeVar; } \ virtual char *prepData( char *data, char *buffer, bufferLen); \ }; \ ## type gConsoleType ## type ## Instance;
ConsoleProcessData(type) char *##type::prepData( char *data, char *buffer, bufferSz)
ConsoleSetType(type) ##type::setData( *dptr, argc, char **argv, *tbl, flag)
ConsoleType(typeName, type, nativeType, typePrefix) type; \ class ConsoleType##type : public \ { \ public: \ typedef nativeType ; \ ConsoleType##type() \ : ( sizeof( nativeType ), &type, #type ) \ { \ mTypeInfo = < nativeType >(); \ } \ virtual setData( *dptr, argc, char **argv, *tbl, flag); \ virtual char *getData( *dptr, *tbl, flag ); \ virtual char *getTypeClassName() { return #typeName ; } \ virtual *getNativeVariable() { * var = ; return (*)var; } \ virtual deleteNativeVariable(* var) { * nativeVar = reinterpret_cast<*>(var); delete nativeVar; } \ virtual getTypePrefix( ) { return ->insert( typePrefix ); } \ }; \ ConsoleType ## type gConsoleType ## type ## Instance;
ConsoleTypeFieldPrefix(type, typePrefix) ##type::getTypePrefix( ) { return ->insert( typePrefix ); }
DefineBitfieldType(type) ( type ); \ ( Type ## type, type );
DefineBitfieldType_R(type) ( type ); \ ( Type ## type, type );
DefineConsoleType(type, nativeType) extern type; \ extern char* castConsoleTypeToString( < nativeType >::ConstType &arg ); \ extern bool castConsoleTypeFromString( nativeType &arg, char *str ); \ template<> < nativeType >();
DefineEnumType(type) ( type ); \ ( Type ## type, type );
DefineEnumType_R(type) ( type ); \ ( Type ## type, type );
DefineUnmappedConsoleType(type, nativeType) ( type, nativeType ) \ template<> inline * < nativeType >() { return ; }
EndImplementBitfieldType()
EndImplementEnumType()
ImplementBitfieldType(type, doc) ( type, Type ## type, type ) \ ( type, type,, doc )
ImplementConsoleTypeCasters(type, nativeType) char *castConsoleTypeToString( < nativeType >::ConstType &arg ) { return (type, const_cast< nativeType* >( &arg ), 0); } \ bool castConsoleTypeFromString( nativeType &arg, char *str ) { (type, const_cast< nativeType* >( &arg ), 0, 1, &str); return true; } \ template<> < nativeType >() { return type; }
ImplementEnumType(type, doc) ( type, Type ## type, type ) \ ( type, type,, doc )
Public Functions
_MAPTYPE()
TYPEID()
Return the type ID for the primary console type associated with the given native type.
There can only be one console type associated with a C++ type. This is referred to as the primary console type.
return:
The type ID of the primary console type for "T".
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _DYNAMIC_CONSOLETYPES_H_ 25#define _DYNAMIC_CONSOLETYPES_H_ 26 27#ifndef _CONSOLE_H_ 28#include "console/console.h" 29#endif 30 31#ifndef _STRINGFUNCTIONS_H_ 32#include "core/strings/stringFunctions.h" 33#endif 34 35#ifndef _ENGINETYPEINFO_H_ 36#include "console/engineTypeInfo.h" 37#endif 38 39#ifndef _STRINGTABLE_H_ 40#include "core/stringTable.h" 41#endif 42 43/// @file 44/// Support for legacy TorqueScript console types. 45 46 47/// Information about a console type. 48class ConsoleBaseType 49{ 50 protected: 51 52 /// Unique numeric type ID. 53 S32 mTypeID; 54 55 /// Size of a single data value point. 56 dsize_t mTypeSize; 57 58 /// Name of this console type (TypeXXX). 59 StringTableEntry mTypeName; 60 61 /// Name of GuiInspectorField subclass to instantiate for field edit controls in 62 /// inspectors. 63 const char* mInspectorFieldType; 64 65 /// Next item in the list of all console types. 66 ConsoleBaseType* mListNext; 67 68 /// Type info object for the engine type corresponding to this console type. 69 /// Since several console types may be mapped to a single native type, this type info 70 /// instance may be shared by multiple ConsoleBaseType instances. 71 /// NULL if the console type is not mapped to an engine API type. 72 const EngineTypeInfo* mTypeInfo; 73 74 /// Total number of defined console types. This is used to generate unique IDs for each type. 75 static S32 smConsoleTypeCount; 76 77 /// We maintain a linked list of all console types; this is its head. 78 static ConsoleBaseType* smListHead; 79 80 /// The constructor is responsible for linking an element into the 81 /// master list, registering the type ID, etc. 82 ConsoleBaseType( const S32 size, S32 *idPtr, const char *aTypeName ); 83 84 /// Destructor is private to avoid people mucking up the list. 85 ~ConsoleBaseType() {} 86 87 public: 88 89 /// @name cbt_list List Interface 90 /// 91 /// Interface for accessing/traversing the list of types. 92 93 /// Get the head of the list. 94 static ConsoleBaseType *getListHead(); 95 96 /// Get the item that follows this item in the list. 97 ConsoleBaseType *getListNext() const 98 { 99 return mListNext; 100 } 101 102 /// @} 103 104 /// Called once to initialize the console type system. 105 static void initialize(); 106 107 /// Call me to get a pointer to a type's info. 108 static ConsoleBaseType *getType( const S32 typeID ); 109 110 /// Call to get a pointer to a type's info 111 static ConsoleBaseType *getTypeByName( const char *typeName ); 112 static ConsoleBaseType *getTypeByClassName( const char *typeName ); 113 114 /// Return the unique numeric ID of this type. 115 S32 getTypeID() const { return mTypeID; } 116 117 /// Return the size of a single value in bytes. 118 S32 getTypeSize() const { return mTypeSize; } 119 120 /// Return the console type name (TypeXXX). 121 StringTableEntry getTypeName() const { return mTypeName; } 122 123 /// Return the type info for the engine type corresponding to this console type or NULL if 124 /// there is no mapping for the console type. 125 const EngineTypeInfo* getTypeInfo() const { return mTypeInfo; } 126 127 /// Return the documentation string for this type. 128 const char* getDocString() const { return getTypeInfo() ? getTypeInfo()->getDocString() : ""; } 129 130 /// Return the EnumTable for this type (only for enumeration types). 131 const EngineEnumTable* getEnumTable() const { return getTypeInfo() ? getTypeInfo()->getEnumTable() : NULL; } 132 133 /// Return the name of the GuiInspectorField subclass that fields of this 134 /// type should use for editing. 135 const char* getInspectorFieldType() { return mInspectorFieldType; } 136 137 /// Set the name of the GuiInspectorField subclass that fields of this type 138 /// should use for editing. 139 void setInspectorFieldType( const char* type ) { mInspectorFieldType = type; } 140 141 /// @name Value Handling Interface 142 /// @{ 143 144 virtual void setData( void* dptr, S32 argc, const char** argv, const EnumTable* tbl, BitSet32 flag ) = 0; 145 virtual const char* getData( void* dptr, const EnumTable* tbl, BitSet32 flag ) = 0; 146 virtual const char* getTypeClassName() = 0; 147 148 /// Allocate a single value. 149 virtual void* getNativeVariable() = 0; 150 151 /// Delete a single value allocated with getNativeVariable(). 152 virtual void deleteNativeVariable(void* var) = 0; 153 154 /// Return true if this is datablock object type. 155 virtual const bool isDatablock() { return false; }; 156 157 virtual const char* prepData( const char* data, char* buffer, U32 bufferLen ) { return data; }; 158 159 virtual StringTableEntry getTypePrefix(void) const { return StringTable->EmptyString(); } 160 161 /// @} 162}; 163 164 165class EnumConsoleBaseType : public ConsoleBaseType 166{ 167 public: 168 169 typedef ConsoleBaseType Parent; 170 171 protected: 172 173 EnumConsoleBaseType( S32 size, S32* idPtr, const char* typeName ) 174 : Parent( size, idPtr, typeName ) {} 175 176 public: 177 178 virtual const char* getData(void *dptr, const EnumTable *tbl, BitSet32 flag) 179 { 180 S32 dptrVal = *( S32* ) dptr; 181 if( !tbl ) tbl = getEnumTable(); 182 const U32 numEnums = tbl->getNumValues(); 183 for( U32 i = 0; i < numEnums; ++ i ) 184 if( dptrVal == ( *tbl )[ i ].mInt ) 185 return ( *tbl )[ i ].mName; 186 return ""; 187 } 188 virtual void setData(void *dptr, S32 argc, const char **argv, const EnumTable *tbl, BitSet32 flag) 189 { 190 if( argc != 1 ) return; 191 if( !tbl ) tbl = getEnumTable(); 192 S32 val = 0; 193 const U32 numEnums = tbl->getNumValues(); 194 for( U32 i = 0; i < numEnums; ++ i ) 195 if( dStricmp( argv[ 0 ], ( *tbl )[ i ].mName ) == 0 ) 196 { 197 val = ( *tbl )[ i ].mInt; 198 break; 199 } 200 *( ( S32* ) dptr ) = val; 201 } 202}; 203 204 205class BitfieldConsoleBaseType : public ConsoleBaseType 206{ 207 public: 208 209 typedef ConsoleBaseType Parent; 210 211 protected: 212 213 BitfieldConsoleBaseType( S32 size, S32* idPtr, const char* typeName ) 214 : Parent( size, idPtr, typeName ) {} 215 216 public: 217 218 virtual const char* getData( void* dptr, const EnumTable*, BitSet32 ) 219 { 220 static const U32 bufSize = 256; 221 char* returnBuffer = Con::getReturnBuffer(bufSize); 222 dSprintf(returnBuffer, bufSize, "0x%08x", *((S32 *) dptr) ); 223 return returnBuffer; 224 } 225 virtual void setData( void* dptr, S32 argc, const char** argv, const EnumTable*, BitSet32 ) 226 { 227 if( argc != 1 ) return; \ 228 *((S32 *) dptr) = dAtoui(argv[0],0); \ 229 } 230}; 231 232 233 234template< typename T > 235struct _ConsoleConstType 236{ 237 typedef const T ConstType; 238}; 239 240/// Return the type ID for the primary console type associated with the given native type. 241/// 242/// There can only be one console type associated with a C++ type. This is referred to as the primary 243/// console type. 244/// 245/// @return The type ID of the primary console type for "T". 246template< typename T > 247S32 TYPEID() { return T::_smTypeId; } // Default assumes a structured type storing its ID in a static member variable. 248 249 250// Helper to allow to override certain mappings. 251template< typename T > 252const EngineTypeInfo* _MAPTYPE() { return TYPE< T >(); } 253 254 255/// @name Console Type Macros 256/// @{ 257 258#define DefineConsoleType( type, nativeType ) \ 259 extern S32 type; \ 260 extern const char* castConsoleTypeToString( _ConsoleConstType< nativeType >::ConstType &arg ); \ 261 extern bool castConsoleTypeFromString( nativeType &arg, const char *str ); \ 262 template<> S32 TYPEID< nativeType >(); 263 264#define DefineUnmappedConsoleType( type, nativeType ) \ 265 DefineConsoleType( type, nativeType ) \ 266 template<> inline const EngineTypeInfo* _MAPTYPE< nativeType >() { return NULL; } 267 268#define ConsoleType( typeName, type, nativeType, typePrefix ) \ 269 S32 type; \ 270 class ConsoleType##type : public ConsoleBaseType \ 271 { \ 272 public: \ 273 typedef nativeType T; \ 274 ConsoleType##type() \ 275 : ConsoleBaseType( sizeof( nativeType ), &type, #type ) \ 276 { \ 277 mTypeInfo = _MAPTYPE< nativeType >(); \ 278 } \ 279 virtual void setData(void *dptr, S32 argc, const char **argv, const EnumTable *tbl, BitSet32 flag); \ 280 virtual const char *getData(void *dptr, const EnumTable *tbl, BitSet32 flag ); \ 281 virtual const char *getTypeClassName() { return #typeName ; } \ 282 virtual void *getNativeVariable() { T* var = new T; return (void*)var; } \ 283 virtual void deleteNativeVariable(void* var) { T* nativeVar = reinterpret_cast<T*>(var); delete nativeVar; } \ 284 virtual StringTableEntry getTypePrefix( void ) const { return StringTable->insert( typePrefix ); } \ 285 }; \ 286 ConsoleType ## type gConsoleType ## type ## Instance; 287 288#define ImplementConsoleTypeCasters( type, nativeType ) \ 289 const char *castConsoleTypeToString( _ConsoleConstType< nativeType >::ConstType &arg ) { return Con::getData(type, const_cast< nativeType* >( &arg ), 0); } \ 290 bool castConsoleTypeFromString( nativeType &arg, const char *str ) { Con::setData(type, const_cast< nativeType* >( &arg ), 0, 1, &str); return true; } \ 291 template<> S32 TYPEID< nativeType >() { return type; } 292 293 294#define ConsolePrepType( typeName, type, nativeType ) \ 295 S32 type; \ 296 class ConsoleType##type : public ConsoleBaseType \ 297 { \ 298 public: \ 299 typedef nativeType T; \ 300 ConsoleType##type() \ 301 : ConsoleBaseType( sizeof( nativeType ), &type, #type ) \ 302 { \ 303 mTypeInfo = _MAPTYPE< nativeType >(); \ 304 } \ 305 virtual void setData(void *dptr, S32 argc, const char **argv, const EnumTable *tbl, BitSet32 flag); \ 306 virtual const char *getData(void *dptr, const EnumTable *tbl, BitSet32 flag ); \ 307 virtual const char *getTypeClassName() { return #typeName ; } \ 308 virtual void *getNativeVariable() { T* var = new T; return (void*)var; } \ 309 virtual void deleteNativeVariable(void* var) { T* nativeVar = reinterpret_cast<T*>(var); delete nativeVar; } \ 310 virtual const char *prepData(const char *data, char *buffer, U32 bufferLen); \ 311 }; \ 312 ConsoleType ## type gConsoleType ## type ## Instance; 313 314#define ConsoleTypeFieldPrefix( type, typePrefix ) \ 315 StringTableEntry ConsoleType##type::getTypePrefix( void ) const { return StringTable->insert( typePrefix ); } 316 317#define ConsoleSetType( type ) \ 318 void ConsoleType##type::setData(void *dptr, S32 argc, const char **argv, const EnumTable *tbl, BitSet32 flag) 319 320#define ConsoleGetType( type ) \ 321 const char *ConsoleType##type::getData(void *dptr, const EnumTable *tbl, BitSet32 flag) 322 323#define ConsoleProcessData( type ) \ 324 const char *ConsoleType##type::prepData(const char *data, char *buffer, U32 bufferSz) 325 326 327#define DefineEnumType( type ) \ 328 DECLARE_ENUM( type ); \ 329 DefineConsoleType( Type ## type, type ); 330 331#define DefineEnumType_R( type ) \ 332 DECLARE_ENUM_R( type ); \ 333 DefineConsoleType( Type ## type, type ); 334 335#define _ConsoleEnumType( typeName, type, nativeType ) \ 336 S32 type; \ 337 ImplementConsoleTypeCasters( type, nativeType ) \ 338 class EnumConsoleType ## type : public EnumConsoleBaseType \ 339 { \ 340 public: \ 341 EnumConsoleType ## type() \ 342 : EnumConsoleBaseType( sizeof( nativeType ), &type, #type ) \ 343 { \ 344 mTypeInfo = _MAPTYPE< nativeType >(); \ 345 } \ 346 virtual const char *getTypeClassName() { return #typeName; } \ 347 virtual void *getNativeVariable() { return new nativeType; } \ 348 virtual void deleteNativeVariable(void* var) { nativeType* nativeVar = reinterpret_cast< nativeType* >( var ); delete nativeVar; }\ 349 }; \ 350 EnumConsoleType ## type gConsoleType ## type ## Instance; 351 352#define ImplementEnumType( type, doc ) \ 353 _ConsoleEnumType( type, Type ## type, type ) \ 354 IMPLEMENT_ENUM( type, type,, doc ) 355 356#define EndImplementEnumType \ 357 END_IMPLEMENT_ENUM 358 359 360#define DefineBitfieldType( type ) \ 361 DECLARE_BITFIELD( type ); \ 362 DefineConsoleType( Type ## type, type ); 363 364#define DefineBitfieldType_R( type ) \ 365 DECLARE_BITFIELD_R( type ); \ 366 DefineConsoleType( Type ## type, type ); 367 368#define _ConsoleBitfieldType( typeName, type, nativeType ) \ 369 S32 type; \ 370 ImplementConsoleTypeCasters( type, nativeType ) \ 371 class BitfieldConsoleType ## type : public BitfieldConsoleBaseType \ 372 { \ 373 public: \ 374 BitfieldConsoleType ## type() \ 375 : BitfieldConsoleBaseType( sizeof( nativeType ), &type, #type ) \ 376 { \ 377 mTypeInfo = _MAPTYPE< nativeType >(); \ 378 } \ 379 virtual const char *getTypeClassName() { return #typeName; } \ 380 virtual void *getNativeVariable() { return new nativeType; } \ 381 virtual void deleteNativeVariable(void* var) { nativeType* nativeVar = reinterpret_cast< nativeType* >( var ); delete nativeVar; }\ 382 }; \ 383 BitfieldConsoleType ## type gConsoleType ## type ## Instance; 384 385#define ImplementBitfieldType( type, doc ) \ 386 _ConsoleBitfieldType( type, Type ## type, type ) \ 387 IMPLEMENT_BITFIELD( type, type,, doc ) 388 389#define EndImplementBitfieldType \ 390 END_IMPLEMENT_BITFIELD 391 392/// @} 393 394#endif 395
