⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 counterthresholdjni.cpp

📁 270的linux说明
💻 CPP
📖 第 1 页 / 共 2 页
字号:
/*

Copyright (c) 2008, Intel Corporation. 

All rights reserved.

 

Redistribution and use in source and binary forms, with or without modification, 
are permitted provided that the following conditions are met:


    * Redistributions of source code must retain the above copyright notice, 
this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright notice, 
this list of conditions and the following disclaimer in the documentation and/or 
other materials provided with the distribution.

    * Neither the name of Intel Corporation nor the names of its contributors 
may be used to endorse or promote products derived from this software without 
specific prior written permission.

 

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
OF SUCH DAMAGE.

*/#include "IntelMobileJNI.h"#ifdef SHOW_MEMORY_LEAK#include "DebugHeap.h"#define new new(__FILE__, __LINE__)#define malloc(size) (void *)new BYTE[size]#define free(o) delete o#endifusing namespace Intel::Mobile::ThresholdAPI;/***************************************** Counter ******************************************//* * Class:     com_intel_mobile_threshold_CounterThreshold * Method:    GetNotify * Signature: ()Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_threshold_CounterThreshold_GetNotifyNative( JNIEnv *JniEnv, jobject JObject ){	try	{		CounterThreshold * TheCounterThreshold = (CounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return TheCounterThreshold->GetNotify();	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("CounterThreshold"), IntelMobileText("GetNotify()") );	}	return NULL;}/* * Class:     com_intel_mobile_threshold_CounterThreshold * Method:    SetNotify * Signature: (Z)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_threshold_CounterThreshold_SetNotifyNative( JNIEnv *JniEnv, jobject JObject, jboolean bNotify ){	try	{		CounterThreshold * TheCounterThreshold = (CounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return TheCounterThreshold->SetNotify( bNotify ? true : false );	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("CounterThreshold"), IntelMobileText("SetNotify()") );	}	return NULL;}/************************************* ByteCounter ***************************************//* * Class:     com_intel_mobile_threshold_ByteCounterThreshold * Method:    constructor * Signature: ()V */JNIEXPORT void JNICALL Java_com_intel_mobile_threshold_ByteCounterThreshold_constructor( JNIEnv *JniEnv, jobject JObject ){	try	{		ByteCounterThreshold * TheByteCounterThreshold = new ByteCounterThreshold();		Set_nativeObjRef(JniEnv, JObject, (jlong) TheByteCounterThreshold);	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("ByteCounterThreshold"), IntelMobileText("constructor") );	}}/* * Class:     com_intel_mobile_threshold_ByteCounterThreshold * Method:    SetObservedProperty * Signature: (Lcom/intel/mobile/base/ByteProperty;)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_threshold_ByteCounterThreshold_SetObservedPropertyNative( JNIEnv *JniEnv, jobject JObject, jobject observedProperty ){	try	{		ByteCounterThreshold * TheByteCounterThreshold = (ByteCounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		ByteProperty *MyByteProperty = (ByteProperty *) Get_nativeObjRef(JniEnv, observedProperty);		return TheByteCounterThreshold->SetObservedProperty( *MyByteProperty );	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("ByteCounterThreshold"), IntelMobileText("SetObservedProperty()") );	}	return NULL;}/* * Class:     com_intel_mobile_threshold_ByteCounterThreshold * Method:    GetThreshold * Signature: ()B */JNIEXPORT jbyte JNICALL Java_com_intel_mobile_threshold_ByteCounterThreshold_GetThresholdNative( JNIEnv *JniEnv, jobject JObject ){	try	{		ByteCounterThreshold * TheByteCounterThreshold = (ByteCounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return TheByteCounterThreshold->GetThreshold();	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("ByteCounterThreshold"), IntelMobileText("GetThreshold()") );	}	return NULL;}/* * Class:     com_intel_mobile_threshold_ByteCounterThreshold * Method:    SetThreshold * Signature: (B)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_threshold_ByteCounterThreshold_SetThresholdNative( JNIEnv *JniEnv, jobject JObject, jbyte threshold ){	try	{		ByteCounterThreshold * TheByteCounterThreshold = (ByteCounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return TheByteCounterThreshold->SetThreshold( threshold );	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("ByteCounterThreshold"), IntelMobileText("SetThreshold()") );	}	return NULL;}/* * Class:     com_intel_mobile_threshold_ByteCounterThreshold * Method:    GetOffset * Signature: ()B */JNIEXPORT jbyte JNICALL Java_com_intel_mobile_threshold_ByteCounterThreshold_GetOffsetNative( JNIEnv *JniEnv, jobject JObject ){	try	{		ByteCounterThreshold * TheByteCounterThreshold = (ByteCounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return TheByteCounterThreshold->GetOffset();	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("ByteCounterThreshold"), IntelMobileText("GetOffset()") );	}	return NULL;}/* * Class:     com_intel_mobile_threshold_ByteCounterThreshold * Method:    SetOffset * Signature: (B)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_threshold_ByteCounterThreshold_SetOffsetNative( JNIEnv *JniEnv, jobject JObject, jbyte offset ){	try	{		ByteCounterThreshold * TheByteCounterThreshold = (ByteCounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return TheByteCounterThreshold->SetOffset( offset );	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("ByteCounterThreshold"), IntelMobileText("SetOffset()") );	}	return NULL;}/*********************************** DateCounter *****************************************//* * Class:     com_intel_mobile_threshold_DateCounterThreshold * Method:    constructor * Signature: ()V */JNIEXPORT void JNICALL Java_com_intel_mobile_threshold_DateCounterThreshold_constructor( JNIEnv *JniEnv, jobject JObject ){	try	{		DateCounterThreshold * TheDateCounterThreshold = new DateCounterThreshold();		Set_nativeObjRef(JniEnv, JObject, (jlong) TheDateCounterThreshold);	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("DateCounterThreshold"), IntelMobileText("constructor") );	}}/* * Class:     com_intel_mobile_threshold_DateCounterThreshold * Method:    SetObservedProperty * Signature: (Lcom/intel/mobile/base/DateTimeProperty;)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_threshold_DateCounterThreshold_SetObservedPropertyNative( JNIEnv *JniEnv, jobject JObject, jobject observedProperty ){	try	{		DateCounterThreshold * TheDateCounterThreshold = (DateCounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		DateTimeProperty * MyDateTimeProperty = (DateTimeProperty *) Get_nativeObjRef(JniEnv, observedProperty);		return TheDateCounterThreshold->SetObservedProperty( *MyDateTimeProperty );	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("DateCounterThreshold"), IntelMobileText("SetObservedProperty()") );	}	return NULL;}/* * Class:     com_intel_mobile_threshold_DateCounterThreshold * Method:    GetThreshold * Signature: ()Ljava/util/Date; */JNIEXPORT jobject JNICALL Java_com_intel_mobile_threshold_DateCounterThreshold_GetThresholdNative( JNIEnv *JniEnv, jobject JObject ){	try	{		DateCounterThreshold * TheDateCounterThreshold = (DateCounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return DATE2jobject( JniEnv, TheDateCounterThreshold->GetThreshold() );	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("DateCounterThreshold"), IntelMobileText("GetThreshold()" ));	}	return NULL;}/* * Class:     com_intel_mobile_threshold_DateCounterThreshold * Method:    SetThreshold * Signature: (Ljava/util/Date;)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_threshold_DateCounterThreshold_SetThresholdNative( JNIEnv *JniEnv, jobject JObject, jobject threshold ){	try	{		DateCounterThreshold * TheDateCounterThreshold = (DateCounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return TheDateCounterThreshold->SetThreshold( jobject2DATE(JniEnv, threshold) ); 	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("DateCounterThreshold"), IntelMobileText("SetThreshold") );	}	return NULL;}/* * Class:     com_intel_mobile_threshold_DateCounterThreshold * Method:    GetOffset * Signature: ()Ljava/util/Date; */JNIEXPORT jobject JNICALL Java_com_intel_mobile_threshold_DateCounterThreshold_GetOffsetNative( JNIEnv *JniEnv, jobject JObject ){	try	{		DateCounterThreshold * TheDateCounterThreshold = (DateCounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return DATE2jobject( JniEnv, TheDateCounterThreshold->GetOffset() );	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("DateCounterThreshold"), IntelMobileText("GetOffset()") );	}	return NULL;}/* * Class:     com_intel_mobile_threshold_DateCounterThreshold * Method:    SetOffset * Signature: (Ljava/util/Date;)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_threshold_DateCounterThreshold_SetOffsetNative(JNIEnv *JniEnv, jobject JObject, jobject offset ){	try	{		DateCounterThreshold * TheDateCounterThreshold = (DateCounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return TheDateCounterThreshold->SetOffset( jobject2DATE(JniEnv, offset) ); 	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("DateCounterThreshold"), IntelMobileText("SetOffset()") );	}	return NULL;}/************************************** Int64Counter **************************************//* * Class:     com_intel_mobile_threshold_Int64CounterThreshold * Method:    constructor * Signature: ()V */JNIEXPORT void JNICALL Java_com_intel_mobile_threshold_Int64CounterThreshold_constructor( JNIEnv *JniEnv, jobject JObject ){	try	{		Int64CounterThreshold * TheInt64CounterThreshold = new Int64CounterThreshold();		Set_nativeObjRef(JniEnv, JObject, (jlong) TheInt64CounterThreshold);	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("Int64CounterThreshold"), IntelMobileText("constructor") );	}}/* * Class:     com_intel_mobile_threshold_Int64CounterThreshold * Method:    SetObservedProperty * Signature: (Lcom/intel/mobile/base/Int64Property;)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_threshold_Int64CounterThreshold_SetObservedPropertyNative( JNIEnv *JniEnv, jobject JObject, jobject observedProperty ){	try	{		Int64CounterThreshold * TheInt64CounterThreshold = (Int64CounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		Int64Property * MyInt64Property = (Int64Property *) Get_nativeObjRef(JniEnv, observedProperty);		return TheInt64CounterThreshold->SetObservedProperty( *MyInt64Property );	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("Int64CounterThreshold"), IntelMobileText("SetObservedProperty()") );	}	return NULL;}/* * Class:     com_intel_mobile_threshold_Int64CounterThreshold * Method:    GetThreshold * Signature: ()J */JNIEXPORT jlong JNICALL Java_com_intel_mobile_threshold_Int64CounterThreshold_GetThresholdNative( JNIEnv *JniEnv, jobject JObject ){	try	{		Int64CounterThreshold * TheInt64CounterThreshold = (Int64CounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return TheInt64CounterThreshold->GetThreshold();	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("Int64CounterThreshold"), IntelMobileText("GetThreshold()" ));	}	return NULL;}/* * Class:     com_intel_mobile_threshold_Int64CounterThreshold * Method:    SetThreshold * Signature: (J)Z */JNIEXPORT jboolean JNICALL Java_com_intel_mobile_threshold_Int64CounterThreshold_SetThresholdNative( JNIEnv *JniEnv, jobject JObject, jlong threshold ){	try	{		Int64CounterThreshold * TheInt64CounterThreshold = (Int64CounterThreshold *) Get_nativeObjRef(JniEnv, JObject);		return TheInt64CounterThreshold->SetThreshold( threshold );	}	catch (IntelMobileException Ex)	{		ThrowException( JniEnv, Ex );	}	catch (...)	{		ThrowUnknownException( JniEnv, IntelMobileText("Int64CounterThreshold"), IntelMobileText("SetThreshold()") );	}	return NULL;}/*

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -