예제 #1
0
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
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
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
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
String __string_hash_to_string(Dynamic &ioHash)
{
   StringHashBase *hash = static_cast<StringHashBase *>(ioHash.GetPtr());
   if (hash)
      return hash->toString();
   return HX_CSTRING("{}");
}
예제 #4
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
bool  __string_hash_remove(Dynamic &ioHash,String inKey)
{
   StringHashBase *hash = static_cast<StringHashBase *>(ioHash.GetPtr());
   if (!hash)
      return false;
   return hash->remove(inKey);
}
예제 #5
0
파일: Hash.cpp 프로젝트: cbatson/hxcpp
bool  __object_hash_remove(Dynamic &ioHash,Dynamic inKey)
{
   DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
   if (!hash)
      return false;
   return hash->remove(inKey);
}
예제 #6
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
String __string_hash_to_string_raw(Dynamic &ioHash)
{
   StringHashBase *hash = static_cast<StringHashBase *>(ioHash.GetPtr());
   if (hash)
      return hash->toStringRaw();
   return null();
}
예제 #7
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
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
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
Dynamic __object_hash_values(Dynamic &ioHash)
{
   DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
   if (!hash)
      return Array_obj<Dynamic>::__new();
   return hash->values();
}
예제 #9
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
bool  __int_hash_remove(Dynamic &ioHash,int inKey)
{
   IntHashBase *hash = static_cast<IntHashBase *>(ioHash.GetPtr());
   if (!hash)
      return false;
   return hash->remove(inKey);
}
예제 #10
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
Array<int> __int_hash_keys(Dynamic &ioHash)
{
   IntHashBase *hash = static_cast<IntHashBase *>(ioHash.GetPtr());
   if (!hash)
      return Array_obj<int>::__new();
   return hash->keys();
}
예제 #11
0
파일: Hash.cpp 프로젝트: cbatson/hxcpp
String __object_hash_to_string(Dynamic &ioHash)
{
   DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
   if (hash)
      return hash->toString();
   return String();

}
예제 #12
0
파일: Hash.cpp 프로젝트: cbatson/hxcpp
String __int_hash_to_string(Dynamic &ioHash)
{
   IntHashBase *hash = static_cast<IntHashBase *>(ioHash.GetPtr());
   if (hash)
      return hash->toString();
   return String();

}
예제 #13
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
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);
}
예제 #14
0
파일: Hash.cpp 프로젝트: cbatson/hxcpp
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);
}
예제 #15
0
파일: Hash.cpp 프로젝트: cbatson/hxcpp
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;
}
예제 #16
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
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;
}
예제 #17
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
Dynamic  __int_hash_get(Dynamic &ioHash,int inKey)
{
   IntHashBase *hash = static_cast<IntHashBase *>(ioHash.GetPtr());
   if (!hash)
      return null();

   Dynamic result = null();
   hash->query(inKey,result);
   return result;
}
예제 #18
0
bool __instanceof(const Dynamic &inValue, const Dynamic &inType)
{
   if (inValue==null())
      return false;
   if (inType==hx::Object::__SGetClass())
      return true;
   hx::Class c = inType;
   if (c==null())
      return false;
   return c->CanCast(inValue.GetPtr());
}
예제 #19
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
void __int_hash_set_int(Dynamic &ioHash,int inKey,int inValue)
{
   IntHashBase *hash = static_cast<IntHashBase *>(ioHash.GetPtr());
   if (!hash)
   {
      hash = new IntHashInt();
      ioHash = hash;
   }
   else if (hash->store==hashString)
   {
      hash = hash->convertStore(hashObject);
      ioHash = hash;
   }

   ioHash.mPtr = hash->set(inKey,inValue);
}
예제 #20
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
void __string_hash_set_string(Dynamic &ioHash,String inKey, ::String inValue)
{
   StringHashBase *hash = static_cast<StringHashBase *>(ioHash.GetPtr());
   if (!hash)
   {
      hash = new StringHashString();
      ioHash = hash;
   }
   else if (hash->store==hashInt || hash->store==hashFloat)
   {
      hash = hash->convertStore(hashObject);
      ioHash = hash;
   }

   ioHash.mPtr = hash->set(inKey,inValue);
}
예제 #21
0
파일: Hash.cpp 프로젝트: cbatson/hxcpp
void __object_hash_set_string(Dynamic &ioHash,Dynamic inKey, ::String inValue,bool inWeakKeys)
{
   DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
   if (!hash)
   {
      hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashString() :
                          (DynamicHashBase *)new DynamicHashString();
      ioHash = hash;
   }
   else if (hash->store==hashInt || hash->store==hashFloat)
   {
      hash = hash->convertStore(hashObject);
      ioHash = hash;
   }

   hash->set(inKey,inValue);
}
예제 #22
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
void __object_hash_set_int(Dynamic &ioHash,Dynamic inKey,int inValue,bool inWeakKeys)
{
   toRealObject(inKey);
   DynamicHashBase *hash = static_cast<DynamicHashBase *>(ioHash.GetPtr());
   if (!hash)
   {
      hash = inWeakKeys ? (DynamicHashBase *)new WeakDynamicHashInt() :
                          (DynamicHashBase *)new DynamicHashInt();
      ioHash = hash;
   }
   else if (hash->store==hashString)
   {
      hash = hash->convertStore(hashObject);
      ioHash = hash;
   }

   ioHash.mPtr = hash->set(inKey,inValue);
}
예제 #23
0
파일: Hash.cpp 프로젝트: cbatson/hxcpp
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);
}
예제 #24
0
파일: Hash.cpp 프로젝트: flowplay/hxcpp
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);
}
예제 #25
0
파일: Object.cpp 프로젝트: Gama11/hxcpp
bool Object::__Is(Dynamic inClass ) const { return __Is(inClass.GetPtr()); }