本文整理汇总了C++中Dynamic::GetPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ Dynamic::GetPtr方法的具体用法?C++ Dynamic::GetPtr怎么用?C++ Dynamic::GetPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dynamic
的用法示例。
在下文中一共展示了Dynamic::GetPtr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __hxcpp_same_closure
bool __hxcpp_same_closure(Dynamic &inF1,Dynamic &inF2)
{
hx::Object *p1 = inF1.GetPtr();
hx::Object *p2 = inF2.GetPtr();
if (p1==0 || p2==0)
return false;
if ( (p1->__GetHandle() != p2->__GetHandle()))
return false;
return p1->__Compare(p2)==0;
}
示例2: __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);
}
示例3: __string_hash_to_string
String __string_hash_to_string(Dynamic &ioHash)
{
StringHashBase *hash = static_cast<StringHashBase *>(ioHash.GetPtr());
if (hash)
return hash->toString();
return HX_CSTRING("{}");
}
示例4: __string_hash_remove
bool __string_hash_remove(Dynamic &ioHash,String inKey)
{
StringHashBase *hash = static_cast<StringHashBase *>(ioHash.GetPtr());
if (!hash)
return false;
return hash->remove(inKey);
}
示例5: __object_hash_remove
bool __object_hash_remove(Dynamic &ioHash,Dynamic inKey)
{
DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
if (!hash)
return false;
return hash->remove(inKey);
}
示例6: __string_hash_to_string_raw
String __string_hash_to_string_raw(Dynamic &ioHash)
{
StringHashBase *hash = static_cast<StringHashBase *>(ioHash.GetPtr());
if (hash)
return hash->toStringRaw();
return null();
}
示例7:
Array<Dynamic> __object_hash_keys(Dynamic &ioHash)
{
DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
if (!hash)
return Array_obj<String>::__new();
return hash->keys();
}
示例8: __object_hash_values
Dynamic __object_hash_values(Dynamic &ioHash)
{
DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
if (!hash)
return Array_obj<Dynamic>::__new();
return hash->values();
}
示例9: __int_hash_remove
bool __int_hash_remove(Dynamic &ioHash,int inKey)
{
IntHashBase *hash = static_cast<IntHashBase *>(ioHash.GetPtr());
if (!hash)
return false;
return hash->remove(inKey);
}
示例10: __object_hash_to_string
String __object_hash_to_string(Dynamic &ioHash)
{
DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
if (hash)
return hash->toString();
return String();
}
示例11: __int_hash_to_string
String __int_hash_to_string(Dynamic &ioHash)
{
IntHashBase *hash = static_cast<IntHashBase *>(ioHash.GetPtr());
if (hash)
return hash->toString();
return String();
}
示例12: __object_hash_exists
bool __object_hash_exists(Dynamic &ioHash,Dynamic inKey)
{
toRealObject(inKey);
DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
if (!hash)
return false;
return hash->exists(inKey);
}
示例13: __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);
}
示例14: __object_hash_get
Dynamic __object_hash_get(Dynamic &ioHash,Dynamic inKey)
{
DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
if (!hash)
return null();
Dynamic result = null();
hash->query(inKey,result);
return result;
}
示例15: __string_hash_get
Dynamic __string_hash_get(Dynamic &ioHash,String inKey)
{
StringHashBase *hash = static_cast<StringHashBase *>(ioHash.GetPtr());
if (!hash)
return null();
Dynamic result = null();
hash->query(inKey,result);
return result;
}