本文整理汇总了C++中Dynamic::__GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ Dynamic::__GetType方法的具体用法?C++ Dynamic::__GetType怎么用?C++ Dynamic::__GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamic
的用法示例。
在下文中一共展示了Dynamic::__GetType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __int_hash_set
void __int_hash_set(Dynamic &ioHash,int inKey,const Dynamic &value)
{
IntHashBase *hash = static_cast<IntHashBase *>(ioHash.GetPtr());
if (!hash)
{
#ifdef HX_DYNAMIC_HASH_VALUES
hash = new IntHashObject();
#else
if (value==null())
{
hash = new IntHashObject();
}
else
{
hxObjectType type = (hxObjectType)value->__GetType();
if (type==vtInt)
hash = new IntHashInt();
else if (type==vtFloat)
hash = new IntHashFloat();
else if (type==vtString)
hash = new IntHashString();
else // Object or bool
hash = new IntHashObject();
}
#endif
ioHash = hash;
}
else if (hash->store!=hashObject)
{
HashStore want = hashObject;
if (value!=null())
{
hxObjectType type = (hxObjectType)value->__GetType();
if ( type==vtInt)
{
if (hash->store==hashFloat)
want = hashFloat;
else if (hash->store==hashInt)
want = hashInt;
}
else if (type==vtFloat)
{
if (hash->store==hashInt || hash->store==hashFloat)
want =hashFloat;
}
else if (type==vtString)
{
if (hash->store==hashString)
want = hashString;
}
}
if (hash->store!=want)
{
hash = hash->convertStore(want);
ioHash = hash;
}
}
ioHash.mPtr = hash->set(inKey,value);
}
示例2: __string_hash_set
void __string_hash_set(Dynamic &ioHash,String inKey,const Dynamic &value)
{
StringHashBase *hash = static_cast<StringHashBase *>(ioHash.GetPtr());
if (!hash)
{
if (value==null())
{
hash = new StringHashObject();
}
else
{
ObjectType type = (ObjectType)value->__GetType();
if (type==vtBool || type==vtInt)
{
hash = new StringHashInt();
}
else if (type==vtFloat)
hash = new StringHashFloat();
else if (type==vtString)
hash = new StringHashString();
else
hash = new StringHashObject();
}
ioHash = hash;
}
else if (hash->store!=hashObject)
{
HashStore want = hashObject;
if (value!=null())
{
ObjectType type = (ObjectType)value->__GetType();
if (type==vtBool || type==vtInt)
{
if (hash->store==hashFloat)
want = hashFloat;
else if (hash->store==hashInt)
want = hashInt;
}
else if (type==vtFloat)
{
if (hash->store==hashInt || hash->store==hashFloat)
want =hashFloat;
}
else if (type==vtString)
{
if (hash->store==hashString)
want = hashString;
}
}
if (hash->store!=want)
{
hash = hash->convertStore(want);
ioHash = hash;
}
}
hash->set(inKey,value);
}
示例3: __hxcpp_get_kind
String __hxcpp_get_kind(Dynamic inObject)
{
int type = inObject->__GetType();
if (type<vtAbstractBase)
return null();
if (type==(int)(size_t)k_cpp_pointer)
return HX_CSTRING("cpp.Pointer");
ReverseKindMap::const_iterator it = sgReverseKindMap.find(type);
if (it==sgReverseKindMap.end())
return null();
return String(it->second.c_str(), it->second.size()).dup();
}
示例4: __object_hash_set
void __object_hash_set(Dynamic &ioHash,Dynamic inKey,const Dynamic &value,bool inWeakKeys)
{
toRealObject(inKey);
DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
if (!hash)
{
#ifdef HX_DYNAMIC_HASH_VALUES
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashObject() :
(DynamicHashBase *)new DynamicHashObject();
#else
if (value==null())
{
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashObject() :
(DynamicHashBase *)new DynamicHashObject();
}
else
{
hxObjectType type = (hxObjectType)value->__GetType();
if (type==vtInt)
{
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashInt() :
(DynamicHashBase *)new DynamicHashInt();
}
else if (type==vtFloat)
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashFloat() :
(DynamicHashBase *)new DynamicHashFloat();
else if (type==vtString)
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashString() :
(DynamicHashBase *)new DynamicHashString();
else
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashObject() :
(DynamicHashBase *)new DynamicHashObject();
}
#endif
ioHash = hash;
}
else if (hash->store!=hashObject)
{
HashStore want = hashObject;
if (value!=null())
{
hxObjectType type = (hxObjectType)value->__GetType();
if (type==vtInt)
{
if (hash->store==hashFloat)
want = hashFloat;
else if (hash->store==hashInt)
want = hashInt;
}
else if (type==vtFloat)
{
if (hash->store==hashInt || hash->store==hashFloat)
want =hashFloat;
}
else if (type==vtString)
{
if (hash->store==hashString)
want = hashString;
}
}
if (hash->store!=want)
{
hash = hash->convertStore(want);
ioHash = hash;
}
}
ioHash.mPtr = hash->set(inKey,value);
}
示例5: __object_hash_set
void __object_hash_set(Dynamic &ioHash,Dynamic inKey,const Dynamic &value,bool inWeakKeys)
{
DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
if (!hash)
{
if (value==null())
{
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashObject() :
(DynamicHashBase *)new DynamicHashObject();
}
else
{
ObjectType type = (ObjectType)value->__GetType();
if (type==vtBool || type==vtInt)
{
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashInt() :
(DynamicHashBase *)new DynamicHashInt();
}
else if (type==vtFloat)
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashFloat() :
(DynamicHashBase *)new DynamicHashFloat();
else if (type==vtString)
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashString() :
(DynamicHashBase *)new DynamicHashString();
else
hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashObject() :
(DynamicHashBase *)new DynamicHashObject();
}
ioHash = hash;
}
else if (hash->store!=hashObject)
{
HashStore want = hashObject;
if (value!=null())
{
ObjectType type = (ObjectType)value->__GetType();
if (type==vtBool || type==vtInt)
{
if (hash->store==hashFloat)
want = hashFloat;
else if (hash->store==hashInt)
want = hashInt;
}
else if (type==vtFloat)
{
if (hash->store==hashInt || hash->store==hashFloat)
want =hashFloat;
}
else if (type==vtString)
{
if (hash->store==hashString)
want = hashString;
}
}
if (hash->store!=want)
{
hash = hash->convertStore(want);
ioHash = hash;
}
}
hash->set(inKey,value);
}