Exemplo n.º 1
0
	static HNThread Create(ParameterizedStartProc pThreadStart, void * pThreadStartParam, const NObject & parameter)
	{
		NCallback threadStart = NTypes::CreateCallback(ParameterizedThreadStartProcImpl, pThreadStart, pThreadStartParam);
		HNThread handle;
		NCheck(NThreadCreateParameterizedN(threadStart.GetHandle(), parameter.GetHandle(), &handle));
		return handle;
	}
 template<typename T> T GetValue(const NObject & object, NAttributes attributes = naNone, bool * pHasValue = NULL) const
 {
     typename NTypeTraits<T>::NativeType value;
     NBool hasValue;
     NCheck(NPropertyInfoGetValue(GetHandle(), object.GetHandle(), NTypeTraits<T>::GetNativeType().GetHandle(), attributes, &value, sizeof(value), 1, pHasValue ? &hasValue : NULL));
     T v = NTypeTraits<T>::FromNative(value);
     if (pHasValue) *pHasValue = hasValue != 0;
     return v;
 }
	NObjectPart GetObjectPart(const NObject & object) const
	{
		HNObjectPart hObjectPart;
		NCheck(NObjectPartInfoGetObjectPart(GetHandle(), object.GetHandle(), &hObjectPart));
		return FromHandle<NObjectPart>(hObjectPart);
	}
 void SetValue(const NObject & object, const NValue & value) const
 {
     NCheck(NPropertyInfoSetValueN(GetHandle(), object.GetHandle(), value.GetHandle()));
 }
 void ResetValue(const NObject & object) const
 {
     NCheck(NPropertyInfoResetValue(GetHandle(), object.GetHandle()));
 }
 template<typename T> void SetValue(const NObject & object, const T & value, NAttributes attributes = naNone, bool hasValue = true) const
 {
     typename NTypeTraits<T>::NativeType v = NTypeTraits<T>::ToNative(value);
     NCheck(NPropertyInfoSetValue(GetHandle(), object.GetHandle(), NTypeTraits<T>::GetNativeType().GetHandle(), attributes, &value, sizeof(value), 1, hasValue ? NTrue : NFalse));
 }
 void SetValue(const NObject & object, const NType & valueType, NAttributes attributes, const void * arValues, NSizeType valuesSize, NInt valuesLength, bool hasValue = true) const
 {
     NCheck(NPropertyInfoSetValue(GetHandle(), object.GetHandle(), valueType.GetHandle(), attributes, arValues, valuesSize, valuesLength, hasValue ? NTrue : NFalse));
 }