当前位置: 首页>>代码示例>>C++>>正文


C++ Dynamic::__GetType方法代码示例

本文整理汇总了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);
}
开发者ID:flowplay,项目名称:hxcpp,代码行数:60,代码来源:Hash.cpp

示例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);
}
开发者ID:cbatson,项目名称:hxcpp,代码行数:58,代码来源:Hash.cpp

示例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();
}
开发者ID:Shin-NiL,项目名称:hxcpp,代码行数:12,代码来源:CFFI.cpp

示例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);
}
开发者ID:flowplay,项目名称:hxcpp,代码行数:69,代码来源:Hash.cpp

示例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);
}
开发者ID:cbatson,项目名称:hxcpp,代码行数:63,代码来源:Hash.cpp


注:本文中的Dynamic::__GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。