Revert commit that modified OCRepresentation and AttribueValue 07/20007/3
authorGeorge Nash <george.nash@intel.com>
Wed, 17 May 2017 20:36:36 +0000 (13:36 -0700)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Fri, 19 May 2017 01:02:04 +0000 (01:02 +0000)
The commit for [IOT-1583] had several unseen concequnces and
should not be on the 1.3-rel branch.

This change reverts that commit as well as two commits
that were made in responce to that commit.

Revert "resource: Avoid to expose internal headers"
This reverts commit 6303c498fcebe1304983e5a650e5e6ec712e0cab.

Revert "[IOT-2251] Resolve getValue() & setValue() APIs for argument string, Attribute Value"
This reverts commit 05671f38527acd30ff5a761b3c0a7cde933a0b17.

Revert "IOT-1583: Fixing /W3 warnings in /resource directory - part 5."
This reverts commit 924a7f267298aafc379ee0fa62871724e8afce19.

See also the following bugs
Bug: https://jira.iotivity.org/browse/IOT-2233
Bug: https://jira.iotivity.org/browse/IOT-2251
Bug: https://jira.iotivity.org/browse/IOT-2277
Bug: https://jira.iotivity.org/browse/IOT-1583
Bug: https://jira.iotivity.org/browse/IOT-2254

Change-Id: I6ca8fad887ff7a17a0bceacfe0ba2147d64c9394
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20007
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Tested-by: Dan Mihai <Daniel.Mihai@microsoft.com>
30 files changed:
build_common/windows/SConscript
extlibs/cjson/SConscript
extlibs/gtest/SConscript
extlibs/libcoap/SConscript
extlibs/mbedtls/SConscript
extlibs/sqlite3/SConscript
java/jni/JniOcRepresentation.cpp
java/jni/JniOcRepresentation.h
java/jni/JniOcStack.cpp
java/jni/JniOcStack.h
resource/IPCA/unittests/SConscript
resource/c_common/SConscript
resource/c_common/unittests/SConscript
resource/csdk/connectivity/SConscript
resource/csdk/connectivity/test/SConscript
resource/csdk/security/SConscript
resource/csdk/security/unittests/SConscript
resource/csdk/stack/SConscript
resource/csdk/stack/test/SConscript
resource/include/AttributeValue.h
resource/include/OCRepresentation.h
resource/include/OCRepresentationInternal.h [deleted file]
resource/include/StringConstants.h
resource/src/OCRepresentation.cpp
resource/src/OCRepresentationInternal.cpp [deleted file]
resource/src/SConscript
resource/unittests/OCAccountManagerTest.cpp
resource/unittests/OCRepresentationEncodingTest.cpp
resource/unittests/OCRepresentationTest.cpp
service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp

index 4bafebe..3c91339 100644 (file)
@@ -6,6 +6,9 @@ import os.path
 
 # Set common flags
 if env['CC'] == 'cl':
+    #  - warning C4133: incompatible type conversion
+    env.AppendUnique(CCFLAGS=['/we4133'])
+
     # Disable the following warnings:
     #  - warning C4127: conditional expression is constant
     #    - Disabled due to the widespread usage in IoTivity
@@ -22,16 +25,10 @@ if env['CC'] == 'cl':
     #    - Disabled due to IoTivity not being ANSI compatible
     #  - warning C4232: nonstandard extension used: 'read': address of dllimport 'fread' is not static, identity not guaranteed
     #    - fread, frwrite, etc are provided by the platform and cannot be changed.
-    #  - warning C4503: decorated name length exceeded, name was truncated.
-    #    - Might cause issues during linking and debugging.
-    #  - warning C4512: assignment operator could not be generated.
-    #    - It's an acceptable warning displayed only by Visual Studio 2013 compiler.
     #  - warning C4706: assignment within conditional expression
     #    - Disabled due to the widespread usage in IoTivity and low impact.
-    env.AppendUnique(CCFLAGS=['/wd4127', '/wd4200', '/wd4201', '/wd4204', '/wd4214', '/wd4221', '/wd4232', '/wd4503', '/wd4512', '/wd4706'])
+    env.AppendUnique(CCFLAGS=['/wd4127', '/wd4200', '/wd4201', '/wd4204', '/wd4214', '/wd4221', '/wd4232', '/wd4706'])
 
-    # Enabling /W3 warnings globally for Windows builds.
-    env.AppendUnique(CCFLAGS=['/W3', '/WX'])
     env.AppendUnique(CCFLAGS=['/EHsc'])
 
     # Set release/debug flags
@@ -44,12 +41,12 @@ if env['CC'] == 'cl':
 
     env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
 
-    # Work around [IOT-1986]
-    # During some Windows multi-threaded builds, SCons/Python/Pywin32 appear to try
-    # linking with these static libraries while another SCons thread started executing
-    # InstallTarget() for this static LIB, but didn't finish yet. That behavior results
-    # in linker errors. Work around this issue by linking with the source of InstallTarget(),
-    # rather than the target.
+    # Work around [IOT-1986]\r
+    # During some Windows multi-threaded builds, SCons/Python/Pywin32 appear to try\r
+    # linking with these static libraries while another SCons thread started executing\r
+    # InstallTarget() for this static LIB, but didn't finish yet. That behavior results\r
+    # in linker errors. Work around this issue by linking with the source of InstallTarget(),\r
+    # rather than the target.\r
     env.PrependUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource', 'src')])
     env.PrependUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource', 'c_common', 'windows')])
     env.PrependUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource', 'oc_logger')])
@@ -68,7 +65,7 @@ if env['CC'] == 'cl':
     # will not work on all systems supported by IoTivity. This will prevent Visual
     # Studio from displaying unwanted warnings.
     # See https://msdn.microsoft.com/en-us/library/ttcz0bys.aspx for more details.
-    env.AppendUnique(CPPDEFINES=['_CRT_SECURE_NO_WARNINGS', '_CRT_NONSTDC_NO_WARNINGS', '_SCL_SECURE_NO_WARNINGS'])
+    env.AppendUnique(CPPDEFINES=['_CRT_SECURE_NO_WARNINGS', '_CRT_NONSTDC_NO_WARNINGS'])
 
 elif env['CC'] == 'gcc':
     print "\nError: gcc not supported on Windows.  Use Visual Studio!\n"
index 58d2872..8365b70 100644 (file)
@@ -26,7 +26,7 @@ if cjson_env.get('TARGET_OS') in ['windows', 'msys_nt']:
     # Macro needed for Windows builds to avoid __declspec(dllexport) and __declspec(dllimport) for cJSON APIs.
     cjson_env.AppendUnique(CPPDEFINES = ['CJSON_HIDE_SYMBOLS'])
     if cjson_env['CC'] == 'cl':
-        cjson_env.AppendUnique(CCFLAGS = ['/W4'])
+        cjson_env.AppendUnique(CCFLAGS = ['/W4', '/WX'])
 
 libcjson = cjson_env.StaticLibrary('cjson', ['cJSON.c'], OBJPREFIX='libcjson_')
 cjson_env.InstallTarget(libcjson, 'cjson');
index 7fc0f40..39c0b5f 100644 (file)
@@ -78,8 +78,7 @@ elif target_os in ['windows']:
                gtest_build_env = gtest_env.Clone()
                gtest_build_env.AppendUnique(CPPPATH = [ os.path.join(gtest_dir, 'include') ])
                gtest_build_env.AppendUnique(CXXFLAGS = ['/EHsc'])
-               if gtest_build_env['CC'] == 'cl':
-                       gtest_build_env.AppendUnique(CCFLAGS = ['/W4'])
+               gtest_build_env.AppendUnique(CCFLAGS = ['/W4', '/WX'])
                gtest = gtest_build_env.StaticLibrary(target = 'gtest', source = [ '%s/src/gtest-all.cc' % gtest_dir ])
                gtest_main = gtest_build_env.StaticLibrary(target = 'gtest_main', source = [ '%s/src/gtest_main.cc' % gtest_dir ])
                gtest_env.InstallTarget(gtest, 'gtest')
index aed25af..db2bdbe 100644 (file)
@@ -286,7 +286,7 @@ else:
     libcoap_src = glob.glob(os.path.join(libcoap_src_root, '*.c'))
 
 if libcoap_env['CC'] == 'cl':
-    libcoap_env.AppendUnique(CCFLAGS = ['/W4'])
+    libcoap_env.AppendUnique(CCFLAGS = ['/W4', '/WX'])
 
 libcoap = libcoap_env.StaticLibrary('coap', libcoap_src, OBJPREFIX='libcoap_')
 
index c3568be..ed90ffb 100644 (file)
@@ -107,7 +107,7 @@ else:
 mbedtls_env = env.Clone()
 
 if mbedtls_env['CC'] == 'cl':
-    mbedtls_env.AppendUnique(CCFLAGS = ['/W4'])
+    mbedtls_env.AppendUnique(CCFLAGS = ['/W4', '/WX'])
 
 mbedtls_env.AppendUnique(CPPPATH = [
     mbedtls_dir,
index a7b4c72..97e4c67 100755 (executable)
@@ -40,8 +40,7 @@ if target_os in targets_need_sqlite:
         shutil.rmtree(sqlite_tmp_dir)
 
 if target_os in ['windows']:
-    if sqlite_env['CC'] == 'cl':
-        sqlite_env.AppendUnique(CCFLAGS = ['/W4'])
+    sqlite_env.AppendUnique(CCFLAGS = ['/W4', '/WX'])
     libsqlite3 = sqlite_env.StaticLibrary('sqlite3', sqlite_c)
     # In multi-threaded builds, SCons appears to proceed to using sqlite3.lib
     # before finishing InstallTarget(libsqlite3, 'sqlite3') here. So, use the
index a70360b..27e96a9 100644 (file)
@@ -127,30 +127,6 @@ JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueInteger
     rep->setValue(str, static_cast<int>(jValue));
 }
 
-/*
-* Class:     org_iotivity_base_OcRepresentation
-* Method:    setValueLong
-* Signature: (Ljava/lang/String;J)V
-*/
-JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueLong
-(JNIEnv *env, jobject thiz, jstring jKey, jlong jValue)
-{
-    LOGD("OcRepresentation_setValueLong");
-    if (!jKey)
-    {
-        ThrowOcException(OC_STACK_INVALID_PARAM, "key cannot be null");
-        return;
-    }
-    OCRepresentation *rep = JniOcRepresentation::getOCRepresentationPtr(env, thiz);
-    if (!rep)
-    {
-        return;
-    }
-
-    std::string str = env->GetStringUTFChars(jKey, nullptr);
-    rep->setValue(str, static_cast<int64_t>(jValue));
-}
-
 /*
 * Class:     org_iotivity_base_OcRepresentation
 * Method:    setValueDouble
@@ -389,131 +365,6 @@ JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueInteger3D
     rep->setValue(key, value);
 }
 
-/*
-* Class:     org_iotivity_base_OcRepresentation
-* Method:    setValueLongArray
-* Signature: (Ljava/lang/String;[J)V
-*/
-JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueLongArray
-(JNIEnv *env, jobject thiz, jstring jKey, jlongArray jValue)
-{
-    LOGD("OcRepresentation_setValueLongArray");
-    if (!jKey)
-    {
-        ThrowOcException(OC_STACK_INVALID_PARAM, "key cannot be null");
-        return;
-    }
-
-    const jsize len = env->GetArrayLength(jValue);
-    jlong* longs = env->GetLongArrayElements(jValue, nullptr);
-
-    std::vector<int64_t> value;
-    for (jsize i = 0; i < len; ++i)
-    {
-        value.push_back(static_cast<int64_t>(longs[i]));
-    }
-    env->ReleaseLongArrayElements(jValue, longs, JNI_ABORT);
-
-    OCRepresentation *rep = JniOcRepresentation::getOCRepresentationPtr(env, thiz);
-    if (!rep)
-    {
-        return;
-    }
-
-    std::string key = env->GetStringUTFChars(jKey, nullptr);
-    rep->setValue(key, value);
-}
-
-/*
-* Class:     org_iotivity_base_OcRepresentation
-* Method:    setValueLong2DArray
-* Signature: (Ljava/lang/String;[[J)V
-*/
-JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueLong2DArray
-(JNIEnv *env, jobject thiz, jstring jKey, jobjectArray jValue)
-{
-    LOGD("OcRepresentation__setValueLong2DArray");
-    if (!jKey)
-    {
-        ThrowOcException(OC_STACK_INVALID_PARAM, "key cannot be null");
-        return;
-    }
-    std::vector<std::vector<int64_t>> value;
-    const jsize lenOuter = env->GetArrayLength(jValue);
-    for (jsize j = 0; j < lenOuter; ++j)
-    {
-        jlongArray jInnerArray = static_cast<jlongArray>(env->GetObjectArrayElement(jValue, j));
-        jlong* longs = env->GetLongArrayElements(jInnerArray, nullptr);
-        std::vector<int64_t> innerVector;
-        const jsize lenInner = env->GetArrayLength(jInnerArray);
-        for (jsize i = 0; i < lenInner; ++i)
-        {
-            innerVector.push_back(static_cast<int64_t>(longs[i]));
-        }
-        env->ReleaseLongArrayElements(jInnerArray, longs, JNI_ABORT);
-        env->DeleteLocalRef(jInnerArray);
-        value.push_back(innerVector);
-    }
-
-    OCRepresentation *rep = JniOcRepresentation::getOCRepresentationPtr(env, thiz);
-    if (!rep)
-    {
-        return;
-    }
-
-    std::string key = env->GetStringUTFChars(jKey, nullptr);
-    rep->setValue(key, value);
-}
-
-/*
-* Class:     org_iotivity_base_OcRepresentation
-* Method:    setValueLong3DArray
-* Signature: (Ljava/lang/String;[[[J)V
-*/
-JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueLong3DArray
-(JNIEnv *env, jobject thiz, jstring jKey, jobjectArray jValue)
-{
-    LOGD("OcRepresentation_setValueLong3DArray");
-    if (!jKey)
-    {
-        ThrowOcException(OC_STACK_INVALID_PARAM, "key cannot be null");
-        return;
-    }
-    std::vector<std::vector<std::vector<int64_t>>> value;
-    const jsize lenOuter = env->GetArrayLength(jValue);
-    for (jsize k = 0; k < lenOuter; ++k)
-    {
-        jobjectArray jMiddleArray = static_cast<jobjectArray>(env->GetObjectArrayElement(jValue, k));
-        const jsize lenMiddle = env->GetArrayLength(jMiddleArray);
-        std::vector<std::vector<int64_t>> middleArray;
-        for (jsize j = 0; j < lenMiddle; ++j)
-        {
-            jlongArray jInnerArray = static_cast<jlongArray>(env->GetObjectArrayElement(jMiddleArray, j));
-            jlong* longs = env->GetLongArrayElements(jInnerArray, nullptr);
-            std::vector<int64_t> innerVector;
-            const jsize lenInner = env->GetArrayLength(jInnerArray);
-            for (jsize i = 0; i < lenInner; ++i)
-            {
-                innerVector.push_back(static_cast<int64_t>(longs[i]));
-            }
-            env->ReleaseLongArrayElements(jInnerArray, longs, JNI_ABORT);
-            env->DeleteLocalRef(jInnerArray);
-            middleArray.push_back(innerVector);
-        }
-        env->DeleteLocalRef(jMiddleArray);
-        value.push_back(middleArray);
-    }
-
-    OCRepresentation *rep = JniOcRepresentation::getOCRepresentationPtr(env, thiz);
-    if (!rep)
-    {
-        return;
-    }
-
-    std::string key = env->GetStringUTFChars(jKey, nullptr);
-    rep->setValue(key, value);
-}
-
 /*
 * Class:     org_iotivity_base_OcRepresentation
 * Method:    setValueDoubleArray
index 0db1c09..dc85747 100644 (file)
@@ -52,15 +52,6 @@ struct JObjectConverter : boost::static_visitor < jobject >
             static_cast<jint>(val));
         return jobj;
     }
-
-    jobject operator()(const int64_t& val) const
-    {
-        jobject jobj = env->NewObject(
-            g_cls_Long,
-            g_mid_Long_ctor,
-            static_cast<jlong>(val));
-        return jobj;
-    }
     jobject operator()(const double& val) const
     {
         jobject jobj = env->NewObject(
@@ -110,18 +101,6 @@ struct JObjectConverter : boost::static_visitor < jobject >
         env->SetIntArrayRegion(jIntArray, 0, len, reinterpret_cast<const jint*>(ints));
         return jIntArray;
     }
-    jobject operator()(const std::vector<int64_t>& val) const
-    {
-        size_t len = val.size();
-        jlongArray jLongArray = env->NewLongArray(len);
-        if (!jLongArray)
-        {
-            return nullptr;
-        }
-        const int64_t* longs = &val[0];
-        env->SetLongArrayRegion(jLongArray, 0, len, reinterpret_cast<const jlong*>(longs));
-        return jLongArray;
-    }
     jobject operator()(const std::vector<double>& val) const
     {
         size_t len = val.size();
@@ -395,86 +374,6 @@ struct JObjectConverter : boost::static_visitor < jobject >
         return jOuterArr;
     }
 
-    jobject operator()(const std::vector<std::vector<int64_t>>& val) const
-    {
-        jsize lenOuter = static_cast<jsize>(val.size());
-        jobjectArray jOuterArr = env->NewObjectArray(lenOuter, g_cls_long1DArray, nullptr);
-        if (!jOuterArr)
-        {
-            return nullptr;
-        }
-        for (jsize i = 0; i < lenOuter; ++i)
-        {
-            size_t lenInner = val[i].size();
-            jlongArray jLongArray = env->NewLongArray(lenInner);
-            if (!jLongArray)
-            {
-                return nullptr;
-            }
-            const int64_t* longs = &val[i][0];
-            env->SetLongArrayRegion(jLongArray, 0, lenInner, reinterpret_cast<const jlong*>(longs));
-            if (env->ExceptionCheck())
-            {
-                return nullptr;
-            }
-            env->SetObjectArrayElement(jOuterArr, i, static_cast<jobject>(jLongArray));
-            if (env->ExceptionCheck())
-            {
-                return nullptr;
-            }
-            env->DeleteLocalRef(jLongArray);
-        }
-        return jOuterArr;
-    }
-    jobject operator()(const std::vector<std::vector<std::vector<int64_t>>>& val) const
-    {
-        jsize lenOuter = static_cast<jsize>(val.size());
-        jobjectArray jOuterArr = env->NewObjectArray(lenOuter, g_cls_long2DArray, nullptr);
-        if (!jOuterArr)
-        {
-            return nullptr;
-        }
-
-        for (jsize k = 0; k < lenOuter; ++k)
-        {
-            jsize lenMiddle = static_cast<jsize>(val[k].size());
-            jobjectArray jMiddleArr = env->NewObjectArray(lenMiddle, g_cls_long1DArray, nullptr);
-            if (!jMiddleArr)
-            {
-                return nullptr;
-            }
-
-            for (jsize i = 0; i < lenMiddle; ++i)
-            {
-                jsize lenInner = static_cast<jsize>(val[k][i].size());
-                jlongArray jLongArray = env->NewLongArray(lenInner);
-                if (!jLongArray)
-                {
-                    return nullptr;
-                }
-                const int64_t* longs = &val[k][i][0];
-                env->SetLongArrayRegion(jLongArray, 0, lenInner, reinterpret_cast<const jlong*>(longs));
-                if (env->ExceptionCheck())
-                {
-                    return nullptr;
-                }
-                env->SetObjectArrayElement(jMiddleArr, i, jLongArray);
-                if (env->ExceptionCheck())
-                {
-                    return nullptr;
-                }
-                env->DeleteLocalRef(jLongArray);
-            }
-            env->SetObjectArrayElement(jOuterArr, k, jMiddleArr);
-            if (env->ExceptionCheck())
-            {
-                return nullptr;
-            }
-            env->DeleteLocalRef(jMiddleArr);
-        }
-        return jOuterArr;
-    }
-
     jobject operator()(const std::vector<std::vector<double>>& val) const
     {
         jsize lenOuter = static_cast<jsize>(val.size());
@@ -868,14 +767,6 @@ extern "C" {
     JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueInteger
         (JNIEnv *, jobject, jstring, jint);
 
-    /*
-    * Class:     org_iotivity_base_OcRepresentation
-    * Method:    setValueLong
-    * Signature: (Ljava/lang/String;J)V
-    */
-    JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueLong
-    (JNIEnv *, jobject, jstring, jlong);
-
     /*
     * Class:     org_iotivity_base_OcRepresentation
     * Method:    setValueDouble
@@ -932,30 +823,6 @@ extern "C" {
     JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueInteger3DArray
         (JNIEnv *, jobject, jstring, jobjectArray);
 
-    /*
-    * Class:     org_iotivity_base_OcRepresentation
-    * Method:    setValueLongArray
-    * Signature: (Ljava/lang/String;[J)V
-    */
-    JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueLongArray
-    (JNIEnv *, jobject, jstring, jlongArray);
-
-    /*
-    * Class:     org_iotivity_base_OcRepresentation
-    * Method:    setValueLong2DArray
-    * Signature: (Ljava/lang/String;[[J)V
-    */
-    JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueLong2DArray
-    (JNIEnv *, jobject, jstring, jobjectArray);
-
-    /*
-    * Class:     org_iotivity_base_OcRepresentation
-    * Method:    setValueLong3DArray
-    * Signature: (Ljava/lang/String;[[[J)V
-    */
-    JNIEXPORT void JNICALL Java_org_iotivity_base_OcRepresentation_setValueLong3DArray
-    (JNIEnv *, jobject, jstring, jobjectArray);
-
     /*
     * Class:     org_iotivity_base_OcRepresentation
     * Method:    setValueDoubleArray
index ea57395..0f2df49 100644 (file)
@@ -45,9 +45,6 @@ jclass g_cls_byte3DArray = nullptr;
 jclass g_cls_Integer = nullptr;
 jclass g_cls_int1DArray = nullptr;
 jclass g_cls_int2DArray = nullptr;
-jclass g_cls_Long = nullptr;
-jclass g_cls_long1DArray = nullptr;
-jclass g_cls_long2DArray = nullptr;
 jclass g_cls_Double = nullptr;
 jclass g_cls_double1DArray = nullptr;
 jclass g_cls_double2DArray = nullptr;
@@ -94,7 +91,6 @@ jclass g_cls_OcCloudProvisioning = nullptr;
 #endif
 
 jmethodID g_mid_Integer_ctor = nullptr;
-jmethodID g_mid_Long_ctor = nullptr;
 jmethodID g_mid_Double_ctor = nullptr;
 jmethodID g_mid_Boolean_ctor = nullptr;
 jmethodID g_mid_LinkedList_ctor = nullptr;
@@ -247,26 +243,6 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
     g_cls_int2DArray = (jclass)env->NewGlobalRef(clazz);
     env->DeleteLocalRef(clazz);
 
-    //Long
-    clazz = env->FindClass("java/lang/Long");
-    VERIFY_VARIABLE_NULL(clazz);
-
-    g_cls_Long = (jclass)env->NewGlobalRef(clazz);
-    env->DeleteLocalRef(clazz);
-
-    g_mid_Long_ctor = env->GetMethodID(g_cls_Long, "<init>", "(J)V");
-    VERIFY_VARIABLE_NULL(g_mid_Long_ctor);
-
-    clazz = env->FindClass("[J");
-    VERIFY_VARIABLE_NULL(clazz);
-    g_cls_long1DArray = (jclass)env->NewGlobalRef(clazz);
-    env->DeleteLocalRef(clazz);
-
-    clazz = env->FindClass("[[J");
-    VERIFY_VARIABLE_NULL(clazz);
-    g_cls_long2DArray = (jclass)env->NewGlobalRef(clazz);
-    env->DeleteLocalRef(clazz);
-
     //Double
     clazz = env->FindClass("java/lang/Double");
     VERIFY_VARIABLE_NULL(clazz);
@@ -676,9 +652,6 @@ JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved)
         env->DeleteGlobalRef(g_cls_Integer);
         env->DeleteGlobalRef(g_cls_int1DArray);
         env->DeleteGlobalRef(g_cls_int2DArray);
-        env->DeleteGlobalRef(g_cls_Long);
-        env->DeleteGlobalRef(g_cls_long1DArray);
-        env->DeleteGlobalRef(g_cls_long2DArray);
         env->DeleteGlobalRef(g_cls_Double);
         env->DeleteGlobalRef(g_cls_double1DArray);
         env->DeleteGlobalRef(g_cls_double2DArray);
index 2dba744..7ba3367 100644 (file)
@@ -66,9 +66,6 @@ extern jclass g_cls_byte3DArray;
 extern jclass g_cls_Integer;
 extern jclass g_cls_int1DArray;
 extern jclass g_cls_int2DArray;
-extern jclass g_cls_Long;
-extern jclass g_cls_long1DArray;
-extern jclass g_cls_long2DArray;
 extern jclass g_cls_Double;
 extern jclass g_cls_double1DArray;
 extern jclass g_cls_double2DArray;
@@ -115,7 +112,6 @@ extern jclass g_cls_OcOicSecAcl_resr;
 extern jclass g_cls_OcOicSecAcl_validity;
 
 extern jmethodID g_mid_Integer_ctor;
-extern jmethodID g_mid_Long_ctor;
 extern jmethodID g_mid_Double_ctor;
 extern jmethodID g_mid_Boolean_ctor;
 extern jmethodID g_mid_LinkedList_ctor;
index 1b31b92..a9f7bff 100644 (file)
@@ -97,8 +97,7 @@ if use_iotivity == 0:
         'mockInProcServerWrapper.cpp',
         'mockOCPlatform_impl.cpp',
         'mockOCProvision.cpp',
-        '#/resource/src/OCRepresentation.cpp',
-        '#/resource/src/OCRepresentationInternal.cpp'
+        '#/resource/src/OCRepresentation.cpp'
         ]
 
 if target_os not in ['windows', 'msys_nt']:
index 7ff8eee..8cd962c 100644 (file)
@@ -162,8 +162,8 @@ common_env = env.Clone()
 # Enable treating all warnings as errors
 ######################################################################
 
-if common_env['CC'] == 'cl':
-    common_env.AppendUnique(CCFLAGS=['/W4'])
+if target_os in ['windows', 'msys_nt']:
+    common_env.AppendUnique(CCFLAGS=['/W4', '/WX'])
 
 ######################################################################
 # Add platform-specific helper library
index fd8f65f..8cf52d0 100644 (file)
@@ -27,9 +27,9 @@ Import('test_env')
 common_test_env = test_env.Clone()
 target_os = common_test_env.get('TARGET_OS')
 
-# Enable treating all warnings as errors for VS compiler.
-if common_test_env['CC'] == 'cl':
-    common_test_env.AppendUnique(CCFLAGS=['/W4'])
+# Enable treating all warnings as errors for Windows.
+if target_os in ['windows', 'msys_nt']:
+    common_test_env.AppendUnique(CCFLAGS=['/W4', '/WX'])
 
 SConscript('../oic_string/test/SConscript', exports = { 'test_env' : common_test_env})
 SConscript('../oic_malloc/test/SConscript', exports = { 'test_env' : common_test_env})
index 8e5ba81..6450bcf 100644 (file)
@@ -17,8 +17,8 @@ print "Given OS is %s" % target_os
 print "BUILD_SAMPLE is %s" % build_sample
 print "MQ flag is %s" % with_mq
 
-if connectivity_env['CC'] == 'cl':
-    connectivity_env.AppendUnique(CCFLAGS=['/W4'])
+if target_os in ['msys_nt', 'windows']:
+    connectivity_env.AppendUnique(CCFLAGS=['/W4', '/WX'])
 
 targets_disallow_multitransport = ['arduino']
 
index 5e9e2e6..1d17770 100644 (file)
@@ -85,9 +85,8 @@ if 'SERVER' in rd_mode:
 
 if target_os not in ['msys_nt', 'windows']:
     catest_env.AppendUnique(LIBS = ['m'])
-
-if catest_env['CC'] == 'cl':
-    catest_env.AppendUnique(CCFLAGS=['/W4'])
+else:
+    catest_env.AppendUnique(CCFLAGS=['/W4', '/WX'])
 
 ######################################################################
 # Source files and Targets
index 158b112..081d878 100644 (file)
@@ -57,9 +57,10 @@ libocsrm_env.PrependUnique(CPPPATH = [
 
 if target_os in ['windows', 'msys_nt']:
        libocsrm_env.AppendUnique(LIBPATH = [os.path.join(libocsrm_env.get('BUILD_DIR'), 'resource', 'oc_logger')])
-
-if libocsrm_env['CC'] == 'cl':
-       libocsrm_env.AppendUnique(CCFLAGS=['/W4'])
+    #  - warning C4200: nonstandard extension used: zero-sized array in struct/union
+    #  - warning C4214: nonstandard extension used: bit field types other than int
+    #    - warnings inherited from a header included from libcoap
+       libocsrm_env.AppendUnique(CCFLAGS=['/wd4200', '/wd4214', '/W4', '/WX'])
 
 if target_os in ['linux', 'android', 'tizen', 'msys_nt', 'windows'] and libocsrm_env.get('SECURED') == '1':
        SConscript('provisioning/SConscript', 'libocsrm_env')
index 99dce86..f904504 100644 (file)
@@ -26,8 +26,8 @@ Import('test_env')
 
 security_test_env = test_env.Clone()
 
-if security_test_env['CC'] == 'cl':
-    security_test_env.AppendUnique(CCFLAGS=['/W4'])
+if security_test_env.get('TARGET_OS') in ['windows', 'msys_nt']:
+    security_test_env.AppendUnique(CCFLAGS=['/W4', '/WX'])
 
 SConscript('../unittest/SConscript', exports = { 'test_env' : security_test_env })
 SConscript('../provisioning/unittest/SConscript', exports = { 'test_env' : security_test_env })
index 03eb95d..7cd8486 100644 (file)
@@ -117,12 +117,11 @@ if target_os in ['android', 'linux', 'tizen', 'msys_nt', 'windows']:
         if with_ra:
             liboctbstack_env.AppendUnique(LIBS = ['ra_xmpp'])
 
-if liboctbstack_env['CC'] == 'cl':
-    liboctbstack_env.AppendUnique(CCFLAGS=['/W4'])
-
 if target_os not in ['windows', 'msys_nt']:
     liboctbstack_env.AppendUnique(LIBS = ['m'])
 else:
+    liboctbstack_env.AppendUnique(CCFLAGS=['/W4', '/WX'])
+
     # octbstack.def specifies the list of functions exported by octbstack.dll.
     liboctbstack_env.Replace(WINDOWS_INSERT_DEF = ['1'])
 
index 3ed03a2..5d5228b 100644 (file)
@@ -70,10 +70,9 @@ if 'SERVER' in rd_mode:
 if stacktest_env.get('LOGGING'):
     stacktest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
 
-if stacktest_env['CC'] == 'cl':
-    stacktest_env.AppendUnique(CCFLAGS=['/W4'])
-
-if target_os not in ['msys_nt', 'windows']:
+if target_os in ['msys_nt', 'windows']:
+    stacktest_env.AppendUnique(CCFLAGS=['/W4', '/WX'])
+else:
     stacktest_env.PrependUnique(LIBS = ['m'])
     if target_os in ['tizen', 'linux']:
         stacktest_env.ParseConfig("pkg-config --cflags --libs gobject-2.0 gio-2.0 glib-2.0")
index 8fbf36a..3315356 100644 (file)
@@ -50,7 +50,6 @@ namespace OC
     typedef boost::variant<
         NullType, // Note: this handles the null-type and must match the above static const
         int,
-        int64_t,
         double,
         bool,
         std::string,
@@ -58,7 +57,7 @@ namespace OC
         OCByteString,
 
         // Sequences:
-        std::vector<int64_t>,
+        std::vector<int>,
         std::vector<double>,
         std::vector<bool>,
         std::vector<std::string>,
@@ -66,8 +65,8 @@ namespace OC
         std::vector<OCByteString>,
 
         // Nested sequences:
-        std::vector<std::vector<int64_t>>,
-        std::vector<std::vector<std::vector<int64_t>>>,
+        std::vector<std::vector<int>>,
+        std::vector<std::vector<std::vector<int>>>,
 
         std::vector<std::vector<double>>,
         std::vector<std::vector<std::vector<double>>>,
@@ -116,12 +115,6 @@ namespace OC
         BOOST_STATIC_CONSTEXPR AttributeType type = AttributeType::Integer;
     };
 
-    template<>
-    struct AttributeTypeConvert<int64_t>
-    {
-        BOOST_STATIC_CONSTEXPR AttributeType type = AttributeType::Integer;
-    };
-
     template<>
     struct AttributeTypeConvert<double>
     {
index 31eb038..541cea5 100644 (file)
@@ -36,8 +36,6 @@
 #include <AttributeValue.h>
 #include <StringConstants.h>
 
-#include "platform_features.h"
-
 #ifdef __ANDROID__
 #include "OCAndroid.h"
 #endif
@@ -46,6 +44,7 @@
 
 namespace OC
 {
+
     enum class InterfaceType
     {
         None,
@@ -82,43 +81,8 @@ namespace OC
         private:
             std::vector<OCRepresentation> m_reps;
     };
-
     class OCRepresentation
     {
-        // Verifies if a type is supported by AttributeValue in order to enable
-        // the correct template for a given type.
-        template <typename T>
-        struct IsSupportedType {
-            static const bool value =
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, int64_t>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, double>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, bool>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::string>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, OCRepresentation>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, OCByteString>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<int64_t>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<int64_t>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<std::vector<int64_t>>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<double>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<double>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<std::vector<double>>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<bool>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<bool>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<std::vector<bool>>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::string>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<std::string>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<std::vector<std::string>>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<OCRepresentation>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<OCRepresentation>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<std::vector<OCRepresentation>>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<OCByteString>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<OCByteString>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<std::vector<std::vector<OCByteString>>>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, std::vector<uint8_t>>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, AttributeValue>::value ||
-                std::is_same<typename std::remove_cv<typename std::remove_reference<T>::type>::type, NullType>::value;
-        };
-
         public:
             friend bool operator==(const OC::OCRepresentation&, const OC::OCRepresentation&);
             // Note: Implementation of all constructors and destructors
@@ -193,37 +157,21 @@ namespace OC
 
             bool emptyData() const;
 
-            size_t numberOfAttributes() const;
+            int numberOfAttributes() const;
 
             bool erase(const std::string& str);
 
-            // Implementation is different for all int-related types, because AttributeValue
-            // uses only one (int64_t) type for integers.
-            template<typename T, typename std::enable_if<IsSupportedType<T>::value, int>::type = 0>
-            void setValue(const std::string& str, const T& rhs)
+            template <typename T>
+            void setValue(const std::string& str, const T& val)
             {
-                m_values[str] = rhs;
-            }
-
-            template<typename T, typename std::enable_if<!IsSupportedType<T>::value, int>::type = 0>
-            void setValue(const std::string& str, const T& rhs)
-            {
-                assignAttributeValueContent(rhs, m_values[str]);
+                m_values[str] = val;
             }
 
             // using R-value(or universal ref depending) to move string and vector<uint8_t>
-            // Implementation is different for all int-related types, because AttributeValue
-            // uses only one (int64_t) type for integers.
-            template<typename T, typename std::enable_if<IsSupportedType<T>::value, int>::type = 0>
-            void setValue(const std::string& str, T&& rhs)
+            template <typename T>
+            void setValue(const std::string& str, T&& val)
             {
-                m_values[str] = std::forward<T>(rhs);
-            }
-
-            template<typename T, typename std::enable_if<!IsSupportedType<T>::value, int>::type = 0>
-            void setValue(const std::string& str, T&& rhs)
-            {
-                assignAttributeValueContent(rhs, m_values[str]);
+                m_values[str] = std::forward<T>(val);
             }
 
             const std::map<std::string, AttributeValue>& getValues() const {
@@ -231,107 +179,66 @@ namespace OC
             }
 
             /**
-             *  Retrieve the attribute value associated with the supplied name.
-             *  Implementation is different for all int-related types, because AttributeValue
-             *  uses only one (int64_t) type for integers.
+             *  Retrieve the attribute value associated with the supplied name
              *
              *  @param str Name of the attribute
              *  @param val Value of the attribute
              *  @return The getValue method returns true if the attribute was
-             *        found in the representation. Otherwise it returns false.
-             *
-             *  @throws OCException if retrieving 'int' and the value is outside
-             *                      of 'int' range.
+             *        found in the representation.  Otherwise it returns false.
              */
-            template<typename T, typename std::enable_if<IsSupportedType<T>::value, int>::type = 0>
+            template <typename T>
             bool getValue(const std::string& str, T& val) const
             {
                 auto x = m_values.find(str);
 
-                if (x != m_values.end())
+                if(x!= m_values.end())
                 {
                     try
                     {
                         val = boost::get<T>(x->second);
                         return true;
                     }
-                    catch (boost::bad_get&)
+                    catch (boost::bad_get& e)
                     {
+                        val = T();
+                        return false;
                     }
                 }
-                val = T();
-                return false;
-            }
-
-            template<typename T, typename std::enable_if<!IsSupportedType<T>::value, int>::type = 0>
-            bool getValue(const std::string& str, T& val) const
-            {
-                auto item = m_values.find(str);
-
-                if (item != m_values.end())
+                else
                 {
-                    try
-                    {
-                        retrieveAttributeValueContent(item->second, val);
-                        return true;
-                    }
-                    catch (boost::bad_get&)
-                    {
-                    }
+                    val = T();
+                    return false;
                 }
-                val = T();
-                return false;
             }
 
             /**
-             *  Return the attribute value associated with the supplied name.
-             *  Implementation is different for all int-related types, because AttributeValue
-             *  uses only one (int64_t) type for integers.
+             *  Return the attribute value associated with the supplied name
              *
              *  @param str Name of the attribute
              *  @return When the representation contains the attribute, the
-             *       associated value is returned. Otherwise, getValue
+             *       the associated value is returned.  Otherwise, getValue
              *       returns the default contructed value for the type.
-             *
-             *  @throws OCException if retrieving 'int' and the value is outside
-             *                      of 'int' range.
              */
-            template<typename T, typename std::enable_if<IsSupportedType<T>::value, int>::type = 0>
-            T getValue(const std::string& str) const
-            {
-                auto x = m_values.find(str);
-                if (x != m_values.end())
-                {
-                    try
-                    {
-                        return boost::get<T>(x->second);
-                    }
-                    catch (boost::bad_get&)
-                    {
-                    }
-                }
-                return T();
-            }
-
-            template<typename T, typename std::enable_if<!IsSupportedType<T>::value, int>::type = 0>
+            template <typename T>
             T getValue(const std::string& str) const
             {
                 T val = T();
                 auto x = m_values.find(str);
-                if (x != m_values.end())
+                if(x != m_values.end())
                 {
                     try
                     {
-                        retrieveAttributeValueContent(x->second, val);
+                        val = boost::get<T>(x->second);
                     }
-                    catch (boost::bad_get&)
+                    catch (boost::bad_get& e)
                     {
+                        return val;
                     }
                 }
                 return val;
             }
 
-           /**
+          /**
             *  Retrieve the attributevalue structure associated with the supplied name
             *
             *  @param str Name of the attribute
@@ -380,51 +287,29 @@ namespace OC
                     AttributeType type() const;
                     AttributeType base_type() const;
                     size_t depth() const;
-
-                    template<typename T, typename std::enable_if<IsSupportedType<T>::value, int>::type = 0>
+                    template<typename T>
                     T getValue() const
                     {
                         try
                         {
-                            return boost::get<T>(m_values.at(m_attrName));
+                            return boost::get<T>(m_values[m_attrName]);
                         }
-                        catch (boost::bad_get&)
+                        catch (boost::bad_get& e)
                         {
                             T val = T();
                             return val;
                         }
                     }
 
-                    template<typename T, typename std::enable_if<!IsSupportedType<T>::value, int>::type = 0>
-                    T getValue() const
-                    {
-                        T val = T();
-                        try
-                        {
-                            retrieveAttributeValueContent(m_values.at(m_attrName), val);
-                        }
-                        catch (boost::bad_get&)
-                        {
-                        }
-                        return val;
-                    }
-
                     std::string getValueToString() const;
 
-                    template<typename T, typename std::enable_if<IsSupportedType<T>::value, int>::type = 0>
+                    template<typename T>
                     AttributeItem& operator=(T&& rhs)
                     {
                         m_values[m_attrName] = std::forward<T>(rhs);
                         return *this;
                     }
 
-                    template<typename T, typename std::enable_if<!IsSupportedType<T>::value, int>::type = 0>
-                    AttributeItem& operator=(T&& rhs)
-                    {
-                        assignAttributeValueContent(rhs, m_values[m_attrName]);
-                        return *this;
-                    }
-
                     AttributeItem& operator=(std::nullptr_t /*rhs*/)
                     {
                         NullType t;
@@ -438,7 +323,6 @@ namespace OC
 #if (defined(_MSC_VER) ) || (defined(__GNUC__) && (__GNUC__ <= 5))
                     template<typename T, typename std::enable_if<
                      std::is_same<T, int>::value ||
-                     std::is_same<T, int64_t>::value ||
                      std::is_same<T, double>::value ||
                      std::is_same<T, bool>::value ||
                      std::is_same<T, std::string>::value ||
@@ -447,9 +331,6 @@ namespace OC
                      std::is_same<T, std::vector<int>>::value ||
                      std::is_same<T, std::vector<std::vector<int>>>::value ||
                      std::is_same<T, std::vector<std::vector<std::vector<int>>>>::value ||
-                     std::is_same<T, std::vector<int64_t>>::value ||
-                     std::is_same<T, std::vector<std::vector<int64_t>>>::value ||
-                     std::is_same<T, std::vector<std::vector<std::vector<int64_t>>>>::value ||
                      std::is_same<T, std::vector<double>>::value ||
                      std::is_same<T, std::vector<std::vector<double>>>::value ||
                      std::is_same<T, std::vector<std::vector<std::vector<double>>>>::value ||
@@ -578,16 +459,6 @@ namespace OC
             friend class OCResourceResponse;
             friend class MessageContainer;
 
-            static void retrieveAttributeValueContent(const AttributeValue& attributeValue, int& val);
-            static void retrieveAttributeValueContent(const AttributeValue& attributeValue, std::vector<int>& val);
-            static void retrieveAttributeValueContent(const AttributeValue& attributeValue, std::vector<std::vector<int>>& val);
-            static void retrieveAttributeValueContent(const AttributeValue& attributeValue, std::vector<std::vector<std::vector<int>>>& val);
-
-            static void assignAttributeValueContent(const int& val, AttributeValue& attributeValue);
-            static void assignAttributeValueContent(const std::vector<int>&  val, AttributeValue& attributeValue);
-            static void assignAttributeValueContent(const std::vector<std::vector<int>>&  val, AttributeValue& attributeValue);
-            static void assignAttributeValueContent(const std::vector<std::vector<std::vector<int>>>&  val, AttributeValue& attributeValue);
-
             template<typename T>
             void payload_array_helper(const OCRepPayloadValue* pl, size_t depth);
             template<typename T>
diff --git a/resource/include/OCRepresentationInternal.h b/resource/include/OCRepresentationInternal.h
deleted file mode 100644 (file)
index c54bc1f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* *****************************************************************
- *
- * Copyright 2017 Microsoft
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-#include <vector>
-#include <stdint.h>
-
-namespace OC {
-
-   /**
-    *  Checks if passed 'int64_t' values are within a regular 'int' range.
-    *
-    *  @param[in]   int64Value An 'int64_t' variable or a vector containing such values.
-    *
-    *  @throws OCException if at least one verified value is outside of 'int' range.
-    */
-    void checkValueInIntRange(int64_t int64Value);
-    void checkValueInIntRange(const std::vector<int64_t>& int64Value);
-    void checkValueInIntRange(const std::vector<std::vector<int64_t>>& int64Value);
-    void checkValueInIntRange(const std::vector<std::vector<std::vector<int64_t>>>& int64Value);
-
-   /**
-    *  Copies 'int64_t' values into an 'int' variable.
-    *
-    *  @param[in]   int64Value  An 'int64_t' variable or a vector containing such values.
-    *  @param[out]  intValue    An 'int' variable or a vector containing such values.
-    */
-    void copyInt64Type(int64_t int64Value, int& intValue);
-    void copyInt64Type(const std::vector<int64_t>& int64Value, std::vector<int>& intValue);
-    void copyInt64Type(const std::vector<std::vector<int64_t>>& int64Value, std::vector<std::vector<int>>& intValue);
-    void copyInt64Type(const std::vector<std::vector<std::vector<int64_t>>>& int64Value, std::vector<std::vector<std::vector<int>>>& intValue);
-
-   /**
-    *  Copies 'int' values into an 'int64_t' variable.
-    *
-    *  @param[in]   intValue    An 'int' variable or a vector containing such values.
-    *  @param[out]  int64Value  An 'int64_t' variable or a vector containing such values.
-    */
-    void copyIntType(int intValue, int64_t& int64Value);
-    void copyIntType(const std::vector<int>& intValue, std::vector<int64_t>& int64Value);
-    void copyIntType(const std::vector<std::vector<int>>& intValue, std::vector<std::vector<int64_t>>& int64Value);
-    void copyIntType(const std::vector<std::vector<std::vector<int>>>& intValue, std::vector<std::vector<std::vector<int64_t>>>& int64Value);
-}
\ No newline at end of file
index 861f69c..f4922f1 100644 (file)
@@ -75,7 +75,6 @@ namespace OC
                             "Error: OptionID valid only If-Match(1), If-None-Match(5),"
                             "Location-Path(8), Location-Query(20),"
                             "and from 2048 to 3000 inclusive.";
-        static const char OUT_OF_INT_RANGE[]           = "Value out of range of type 'int'.";
         static const char NO_ERROR[]                   = "No Error";
         static const char RESOURCE_CREATED[]           = "Resource Created";
         static const char RESOURCE_CHANGED[]           = "Resource Changed";
index ac545c9..76002c4 100644 (file)
@@ -27,7 +27,6 @@
 
 
 #include <OCRepresentation.h>
-#include <OCRepresentationInternal.h>
 
 #include <boost/lexical_cast.hpp>
 #include <algorithm>
@@ -124,11 +123,11 @@ namespace OC
             dimensions[2] = 0;
             dimTotal = calcDimTotal(dimensions);
 
-            m_array = (void*)OICMalloc(dimTotal * root_size);
+            array = (void*)OICMalloc(dimTotal * root_size);
 
             for(size_t i = 0; i < dimensions[0]; ++i)
             {
-                copy_to_array(arr[i], m_array, i);
+                copy_to_array(arr[i], array, i);
             }
 
         }
@@ -144,13 +143,13 @@ namespace OC
                 dimensions[1] = std::max(dimensions[1], arr[i].size());
             }
             dimTotal = calcDimTotal(dimensions);
-            m_array = (void*)OICCalloc(1, (dimTotal * root_size));
+            array = (void*)OICCalloc(1, dimTotal * root_size);
 
             for(size_t i = 0; i < dimensions[0]; ++i)
             {
                 for(size_t j = 0; j < dimensions[1] && j < arr[i].size(); ++j)
                 {
-                    copy_to_array(arr[i][j], m_array, i*dimensions[1] + j);
+                    copy_to_array(arr[i][j], array, i*dimensions[1] + j);
                 }
             }
         }
@@ -172,7 +171,7 @@ namespace OC
             }
 
             dimTotal = calcDimTotal(dimensions);
-            m_array = (void*)OICCalloc(1, dimTotal * root_size);
+            array = (void*)OICCalloc(1, dimTotal * root_size);
 
             for(size_t i = 0; i < dimensions[0]; ++i)
             {
@@ -180,7 +179,7 @@ namespace OC
                 {
                     for(size_t k = 0; k < dimensions[2] && k < arr[i][j].size(); ++k)
                     {
-                        copy_to_array(arr[i][j][k], m_array,
+                        copy_to_array(arr[i][j][k], array,
                                 dimensions[2] * j +
                                 dimensions[2] * dimensions[1] * i +
                                 k);
@@ -204,7 +203,7 @@ namespace OC
         size_t dimensions[MAX_REP_ARRAY_DEPTH];
         size_t root_size;
         size_t dimTotal;
-        void* m_array;
+        void* array;
     };
 
     template<>
@@ -292,31 +291,31 @@ namespace OC
         {
             case AttributeType::Integer:
                 OCRepPayloadSetIntArrayAsOwner(payload, item.attrname().c_str(),
-                        (int64_t*)vis.m_array,
+                        (int64_t*)vis.array,
                         vis.dimensions);
                 break;
             case AttributeType::Double:
                 OCRepPayloadSetDoubleArrayAsOwner(payload, item.attrname().c_str(),
-                        (double*)vis.m_array,
+                        (double*)vis.array,
                         vis.dimensions);
                 break;
             case AttributeType::Boolean:
                 OCRepPayloadSetBoolArrayAsOwner(payload, item.attrname().c_str(),
-                        (bool*)vis.m_array,
+                        (bool*)vis.array,
                         vis.dimensions);
                 break;
             case AttributeType::String:
                 OCRepPayloadSetStringArrayAsOwner(payload, item.attrname().c_str(),
-                        (char**)vis.m_array,
+                        (char**)vis.array,
                         vis.dimensions);
                 break;
             case AttributeType::OCByteString:
                 OCRepPayloadSetByteStringArrayAsOwner(payload, item.attrname().c_str(),
-                                                      (OCByteString *)vis.m_array, vis.dimensions);
+                                                      (OCByteString *)vis.array, vis.dimensions);
                 break;
             case AttributeType::OCRepresentation:
                 OCRepPayloadSetPropObjectArrayAsOwner(payload, item.attrname().c_str(),
-                        (OCRepPayload**)vis.m_array, vis.dimensions);
+                        (OCRepPayload**)vis.array, vis.dimensions);
                 break;
             default:
                 throw std::logic_error(std::string("GetPayloadArray: Not Implemented") +
@@ -352,7 +351,7 @@ namespace OC
                     OCRepPayloadSetNull(root, val.attrname().c_str());
                     break;
                 case AttributeType::Integer:
-                    OCRepPayloadSetPropInt(root, val.attrname().c_str(), val.getValue<int64_t>());
+                    OCRepPayloadSetPropInt(root, val.attrname().c_str(), static_cast<int>(val));
                     break;
                 case AttributeType::Double:
                     OCRepPayloadSetPropDouble(root, val.attrname().c_str(),
@@ -418,7 +417,7 @@ namespace OC
         throw std::logic_error("payload_array_helper_copy: unsupported type");
     }
     template<>
-    int64_t OCRepresentation::payload_array_helper_copy<int64_t>(size_t index, const OCRepPayloadValue* pl)
+    int OCRepresentation::payload_array_helper_copy<int>(size_t index, const OCRepPayloadValue* pl)
     {
         return pl->arr.iArray[index];
     }
@@ -528,7 +527,7 @@ namespace OC
         switch(pl->arr.type)
         {
             case OCREP_PROP_INT:
-                payload_array_helper<int64_t>(pl, calcArrayDepth(pl->arr.dimensions));
+                payload_array_helper<int>(pl, calcArrayDepth(pl->arr.dimensions));
                 break;
             case OCREP_PROP_DOUBLE:
                 payload_array_helper<double>(pl, calcArrayDepth(pl->arr.dimensions));
@@ -579,7 +578,7 @@ namespace OC
                     setNULL(val->name);
                     break;
                 case OCREP_PROP_INT:
-                    setValue<int64_t>(val->name, val->i);
+                    setValue<int>(val->name, val->i);
                     break;
                 case OCREP_PROP_DOUBLE:
                     setValue<double>(val->name, val->d);
@@ -775,14 +774,14 @@ namespace OC
         return true;
     }
 
-    size_t OCRepresentation::numberOfAttributes() const
+    int OCRepresentation::numberOfAttributes() const
     {
         return m_values.size();
     }
 
     bool OCRepresentation::erase(const std::string& str)
     {
-        return (m_values.erase(str) != 0);
+        return m_values.erase(str);
     }
 
     void OCRepresentation::setNULL(const std::string& str)
@@ -836,7 +835,7 @@ namespace OC
                 os << "Vector";
                 break;
             case AttributeType::Binary:
-                os << "Binary";
+                os<< "Binary";
         }
         return os;
     }
@@ -1146,62 +1145,6 @@ namespace OC
         str = "OC::OCRepresentation";
     }
 
-    void OCRepresentation::retrieveAttributeValueContent(const AttributeValue& attributeValue, int& val)
-    {
-        int64_t int64Value = boost::get<int64_t>(attributeValue);
-        checkValueInIntRange(int64Value);
-        copyInt64Type(int64Value, val);
-    }
-
-    void OCRepresentation::retrieveAttributeValueContent(const AttributeValue& attributeValue, std::vector<int>& val)
-    {
-        std::vector<int64_t> int64Value = boost::get<std::vector<int64_t>>(attributeValue);
-        checkValueInIntRange(int64Value);
-        copyInt64Type(int64Value, val);
-    }
-
-    void OCRepresentation::retrieveAttributeValueContent(const AttributeValue& attributeValue, std::vector<std::vector<int>>& val)
-    {
-        std::vector<std::vector<int64_t>> int64Value = boost::get<std::vector<std::vector<int64_t>>>(attributeValue);
-        checkValueInIntRange(int64Value);
-        copyInt64Type(int64Value, val);
-    }
-
-    void OCRepresentation::retrieveAttributeValueContent(const AttributeValue& attributeValue, std::vector<std::vector<std::vector<int>>>& val)
-    {
-        std::vector<std::vector<std::vector<int64_t>>> int64Value = boost::get<std::vector<std::vector<std::vector<int64_t>>>>(attributeValue);
-        checkValueInIntRange(int64Value);
-        copyInt64Type(int64Value, val);
-    }
-
-    void OCRepresentation::assignAttributeValueContent(const int& val, AttributeValue& attributeValue)
-    {
-        int64_t value;
-        copyIntType(val, value);
-        attributeValue = value;
-    }
-
-    void OCRepresentation::assignAttributeValueContent(const std::vector<int>&  val, AttributeValue& attributeValue)
-    {
-        std::vector<int64_t> value;
-        copyIntType(val, value);
-        attributeValue = std::move(value);
-    }
-
-    void OCRepresentation::assignAttributeValueContent(const std::vector<std::vector<int>>&  val, AttributeValue& attributeValue)
-    {
-        std::vector<std::vector<int64_t>> value;
-        copyIntType(val, value);
-        attributeValue = std::move(value);
-    }
-
-    void OCRepresentation::assignAttributeValueContent(const std::vector<std::vector<std::vector<int>>>&  val, AttributeValue& attributeValue)
-    {
-        std::vector<std::vector<std::vector<int64_t>>> value;
-        copyIntType(val, value);
-        attributeValue = std::move(value);
-    }
-
     std::string OCRepresentation::getValueToString(const std::string& key) const
     {
         auto x = m_values.find(key);
diff --git a/resource/src/OCRepresentationInternal.cpp b/resource/src/OCRepresentationInternal.cpp
deleted file mode 100644 (file)
index f839c7f..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/* *****************************************************************
- *
- * Copyright 2017 Microsoft
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-#include <limits.h>
-
-#include "OCRepresentationInternal.h"
-#include "OCException.h"
-#include "StringConstants.h"
-
-namespace OC {
-    void checkValueInIntRange(int64_t int64Value)
-    {
-        if ((int64Value > INT_MAX) || (int64Value < INT_MIN))
-        {
-            throw OCException(Exception::OUT_OF_INT_RANGE);
-        }
-    }
-
-    void checkValueInIntRange(const std::vector<int64_t>& int64Value)
-    {
-        for (int64_t value : int64Value)
-        {
-            checkValueInIntRange(value);
-        }
-    }
-
-    void checkValueInIntRange(const std::vector<std::vector<int64_t>>& int64Value)
-    {
-        for (const auto& value : int64Value)
-        {
-            checkValueInIntRange(value);
-        }
-    }
-
-    void checkValueInIntRange(const std::vector<std::vector<std::vector<int64_t>>>& int64Value)
-    {
-        for (const auto& value : int64Value)
-        {
-            checkValueInIntRange(value);
-        }
-    }
-
-    void copyInt64Type(int64_t int64Value, int& intValue)
-    {
-        intValue = (int)int64Value;
-    }
-
-    void copyInt64Type(const std::vector<int64_t>& int64Value, std::vector<int>& intValue)
-    {
-        intValue.resize(int64Value.size());
-        for (size_t index = 0; index < int64Value.size(); index++)
-        {
-            copyInt64Type(int64Value[index], intValue[index]);
-        }
-    }
-
-    void copyInt64Type(const std::vector<std::vector<int64_t>>& int64Value, std::vector<std::vector<int>>& intValue)
-    {
-        intValue.resize(int64Value.size());
-        for (size_t index = 0; index < int64Value.size(); index++)
-        {
-            copyInt64Type(int64Value[index], intValue[index]);
-        }
-    }
-
-    void copyInt64Type(const std::vector<std::vector<std::vector<int64_t>>>& int64Value, std::vector<std::vector<std::vector<int>>>& intValue)
-    {
-        intValue.resize(int64Value.size());
-        for (size_t index = 0; index < int64Value.size(); index++)
-        {
-            copyInt64Type(int64Value[index], intValue[index]);
-        }
-    }
-
-    void copyIntType(int intValue, int64_t& int64Value)
-    {
-        int64Value = intValue;
-    }
-
-    void copyIntType(const std::vector<int>& intValue, std::vector<int64_t>& int64Value)
-    {
-        int64Value.resize(intValue.size());
-        for (size_t index = 0; index < intValue.size(); index++)
-        {
-            copyIntType(intValue[index], int64Value[index]);
-        }
-    }
-
-    void copyIntType(const std::vector<std::vector<int>>& intValue, std::vector<std::vector<int64_t>>& int64Value)
-    {
-        int64Value.resize(intValue.size());
-        for (size_t index = 0; index < intValue.size(); index++)
-        {
-            copyIntType(intValue[index], int64Value[index]);
-        }
-    }
-
-    void copyIntType(const std::vector<std::vector<std::vector<int>>>& intValue, std::vector<std::vector<std::vector<int64_t>>>& int64Value)
-    {
-        int64Value.resize(intValue.size());
-        for (size_t index = 0; index < intValue.size(); index++)
-        {
-            copyIntType(intValue[index], int64Value[index]);
-        }
-    }
-}
\ No newline at end of file
index abf9d55..290496b 100644 (file)
@@ -112,8 +112,7 @@ oclib_src = [
                'InProcClientWrapper.cpp',
                'OCResourceRequest.cpp',
                'CAManager.cpp',
-               'OCDirectPairing.cpp',
-               'OCRepresentationInternal.cpp'
+               'OCDirectPairing.cpp'
        ]
 
 if with_cloud:
index 29f01f8..38a079e 100644 (file)
@@ -306,7 +306,7 @@ namespace OCAccountManagerTest
         std::string host("coap://192.168.1.2:5000");
         std::string groupId("AnyGroupId");
         OCRepresentation propertyValue;
-        propertyValue.setValue("AnyProperty", std::string("AnyValue"));
+        propertyValue.setValue("AnyProperty", "AnyValue");
         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
         EXPECT_TRUE(NULL != accountManager);
         EXPECT_EQ(OC_STACK_OK, accountManager->addPropertyValueToGroup(groupId, propertyValue,
@@ -318,7 +318,7 @@ namespace OCAccountManagerTest
         std::string host("coap://192.168.1.2:5000");
         std::string groupId("AnyGroupId");
         OCRepresentation propertyValue;
-        propertyValue.setValue("AnyProperty", std::string("AnyValue"));
+        propertyValue.setValue("AnyProperty", "AnyValue");
         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
         EXPECT_TRUE(NULL != accountManager);
         EXPECT_ANY_THROW(accountManager->addPropertyValueToGroup(groupId, propertyValue,
@@ -331,7 +331,7 @@ namespace OCAccountManagerTest
         std::string host("coap://192.168.1.2:5000");
         std::string groupId("AnyGroupId");
         OCRepresentation propertyValue;
-        propertyValue.setValue("AnyProperty", std::string("AnyValue"));
+        propertyValue.setValue("AnyProperty", "AnyValue");
         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
         EXPECT_TRUE(NULL != accountManager);
         EXPECT_EQ(OC_STACK_OK, accountManager->deletePropertyValueFromGroup(groupId, propertyValue,
@@ -343,7 +343,7 @@ namespace OCAccountManagerTest
         std::string host("coap://192.168.1.2:5000");
         std::string groupId("AnyGroupId");
         OCRepresentation propertyValue;
-        propertyValue.setValue("AnyProperty", std::string("AnyValue"));
+        propertyValue.setValue("AnyProperty", "AnyValue");
         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
         EXPECT_TRUE(NULL != accountManager);
         EXPECT_ANY_THROW(accountManager->deletePropertyValueFromGroup(groupId, propertyValue,
@@ -356,7 +356,7 @@ namespace OCAccountManagerTest
         std::string host("coap://192.168.1.2:5000");
         std::string groupId("AnyGroupId");
         OCRepresentation propertyValue;
-        propertyValue.setValue("AnyProperty", std::string("AnyValue"));
+        propertyValue.setValue("AnyProperty", "AnyValue");
         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
         EXPECT_TRUE(NULL != accountManager);
         EXPECT_EQ(OC_STACK_OK, accountManager->updatePropertyValueOnGroup(groupId, propertyValue,
@@ -368,7 +368,7 @@ namespace OCAccountManagerTest
         std::string host("coap://192.168.1.2:5000");
         std::string groupId("AnyGroupId");
         OCRepresentation propertyValue;
-        propertyValue.setValue("AnyProperty", std::string("AnyValue"));
+        propertyValue.setValue("AnyProperty", "AnyValue");
         OCAccountManager::Ptr accountManager = ConstructAccountManagerObject(host);
         EXPECT_TRUE(NULL != accountManager);
         EXPECT_ANY_THROW(accountManager->updatePropertyValueOnGroup(groupId, propertyValue,
index 9b1040e..e0c3a45 100644 (file)
@@ -67,7 +67,7 @@ namespace OCRepresentationEncodingTest
         static const char piid1[] = "e987b8f5-527a-454e-98c1-1eef2e5f1cf5";
         const char devicename1[] = "device name";
         OCRepPayload *device = OCRepPayloadCreate();
-        EXPECT_NE((decltype(device))NULL, device);
+        EXPECT_TRUE(device);
         EXPECT_TRUE(OCRepPayloadAddResourceType(device, OC_RSRVD_RESOURCE_TYPE_DEVICE));
         EXPECT_TRUE(OCRepPayloadAddResourceType(device, "oic.d.tv"));
         EXPECT_TRUE(OCRepPayloadSetPropString(device, OC_RSRVD_DEVICE_ID, sid1));
@@ -78,7 +78,7 @@ namespace OCRepresentationEncodingTest
 
         size_t dim[MAX_REP_ARRAY_DEPTH] = {1, 0, 0};
         char **dt = (char **)OICMalloc(sizeof(char *) * 1);
-        EXPECT_NE((decltype(dt))NULL, dt);
+        EXPECT_TRUE(dt);
         dt[0] = OICStrdup(OC_DATA_MODEL_VERSION);
         EXPECT_TRUE(OCRepPayloadSetStringArray(device, OC_RSRVD_DATA_MODEL_VERSION, (const char **)dt, dim));
         OICFree(dt[0]);
@@ -133,7 +133,7 @@ namespace OCRepresentationEncodingTest
         OCPayloadDestroy(parsedDevice);
 
         device = OCRepPayloadCreate();
-        EXPECT_NE((decltype(device))NULL, device);
+        EXPECT_TRUE(device);
         EXPECT_TRUE(OCRepPayloadAddResourceType(device, OC_RSRVD_RESOURCE_TYPE_DEVICE));
         EXPECT_TRUE(OCRepPayloadAddResourceType(device, "oic.d.tv"));
         EXPECT_TRUE(OCRepPayloadSetPropString(device, OC_RSRVD_DEVICE_NAME, devicename1));
@@ -142,7 +142,7 @@ namespace OCRepresentationEncodingTest
         EXPECT_TRUE(OCRepPayloadSetPropString(device, OC_RSRVD_SPEC_VERSION, OC_SPEC_VERSION));
         size_t dim1[MAX_REP_ARRAY_DEPTH] = {2, 0, 0};
         char **dt1 = (char **)OICMalloc(sizeof(char *) * 2);
-        EXPECT_NE((decltype(dt1))NULL, dt1);
+        EXPECT_TRUE(dt1);
         dt1[0] = OICStrdup("ocf.res.1.1.0");
         dt1[1] = OICStrdup("ocf.sh.1.1.0");
         OCRepPayloadSetStringArray(device, OC_RSRVD_DATA_MODEL_VERSION, (const char**)dt1, dim1);
@@ -320,7 +320,6 @@ namespace OCRepresentationEncodingTest
         OC::OCRepresentation startRep;
         startRep.setNULL("NullAttr");
         startRep.setValue("IntAttr", 77);
-        startRep.setValue("Int64Attr", 77LL);
         startRep.setValue("DoubleAttr", 3.333);
         startRep.setValue("BoolAttr", true);
         startRep.setValue("StringAttr", std::string("String attr"));
@@ -353,7 +352,6 @@ namespace OCRepresentationEncodingTest
 
         EXPECT_TRUE(r.isNULL("NullAttr"));
         EXPECT_EQ(77, r.getValue<int>("IntAttr"));
-        EXPECT_EQ(77LL, r.getValue<int64_t>("Int64Attr"));
         EXPECT_EQ(3.333, r.getValue<double>("DoubleAttr"));
         EXPECT_EQ(true, r.getValue<bool>("BoolAttr"));
         EXPECT_STREQ("String attr", r.getValue<std::string>("StringAttr").c_str());
@@ -424,7 +422,6 @@ namespace OCRepresentationEncodingTest
         OC::OCRepresentation subRep;
         subRep.setNULL("NullAttr");
         subRep.setValue("IntAttr", 77);
-        subRep.setValue("Int64Attr", 77LL);
         subRep.setValue("DoubleAttr", 3.333);
         subRep.setValue("BoolAttr", true);
         subRep.setValue("StringAttr", std::string("String attr"));
@@ -456,7 +453,6 @@ namespace OCRepresentationEncodingTest
 
         EXPECT_TRUE(newSubRep.isNULL("NullAttr"));
         EXPECT_EQ(77, newSubRep.getValue<int>("IntAttr"));
-        EXPECT_EQ(77LL, newSubRep.getValue<int64_t>("Int64Attr"));
         EXPECT_EQ(3.333, newSubRep.getValue<double>("DoubleAttr"));
         EXPECT_EQ(true, newSubRep.getValue<bool>("BoolAttr"));
         EXPECT_STREQ("String attr", newSubRep.getValue<std::string>("StringAttr").c_str());
@@ -483,7 +479,6 @@ namespace OCRepresentationEncodingTest
         subRep3.setValue("StringAttr", std::string("String attr"));
 
         std::vector<int> iarr {1,2,3,4,5,6,7,8,9};
-        std::vector<int64_t> i64arr {1LL,2LL,3LL,4LL,5LL,6LL,7LL,8LL,9LL};
         std::vector<double> darr {1.1,2.2,3.3,4.4,5.5,6.6,7.7,8.8,9.9};
         std::vector<bool> barr {false, true, false, false, true, true};
         std::vector<std::string> strarr {"item1", "item2", "item3", "item4"};
@@ -501,7 +496,6 @@ namespace OCRepresentationEncodingTest
         std::vector<OCByteString> bytestrarr {byteString1, byteString2 };
 
         startRep["iarr"] = iarr;
-        startRep["i64arr"] = i64arr;
         startRep["darr"] = darr;
         startRep["barr"] = barr;
         startRep["strarr"] = strarr;
@@ -531,7 +525,6 @@ namespace OCRepresentationEncodingTest
 
         // Test
         std::vector<int> iarr2 = r["iarr"];
-        std::vector<int64_t> i64arr2 = r["i64arr"];
         std::vector<double> darr2 = r["darr"];
         std::vector<bool> barr2 = r["barr"];
         std::vector<std::string> strarr2 = r["strarr"];
@@ -539,7 +532,6 @@ namespace OCRepresentationEncodingTest
         std::vector<OCByteString> bytestrarr2 = r["bytestrarr"];
 
         EXPECT_EQ(iarr, iarr2);
-        EXPECT_EQ(i64arr, i64arr2);
         EXPECT_EQ(darr, darr2);
         EXPECT_EQ(barr, barr2);
         EXPECT_EQ(strarr, strarr2);
@@ -568,7 +560,6 @@ namespace OCRepresentationEncodingTest
         subRep3.setValue("StringAttr", std::string("String attr"));
 
         std::vector<std::vector<int>> iarr {{1,2,3},{4,5,6},{7,8,9}};
-        std::vector<std::vector<int64_t>> i64arr {{1LL,2LL,3LL},{4LL,5LL,6LL},{7LL,8LL,9LL}};
         std::vector<std::vector<double>> darr {{1.1,2.2,3.3},{4.4,5.5,6.6},{7.7,8.8,9.9}};
         std::vector<std::vector<bool>> barr {{false, true}, {false, false}, {true, true}};
         std::vector<std::vector<std::string>> strarr {{"item1", "item2"}, {"item3", "item4"}};
@@ -601,7 +592,6 @@ namespace OCRepresentationEncodingTest
         };
 
         startRep["iarr"] = iarr;
-        startRep["i64arr"] = i64arr;
         startRep["darr"] = darr;
         startRep["barr"] = barr;
         startRep["strarr"] = strarr;
@@ -631,7 +621,6 @@ namespace OCRepresentationEncodingTest
 
         // Test
         std::vector<std::vector<int>> iarr2 = r["iarr"];
-        std::vector<std::vector<int64_t>> i64arr2 = r["i64arr"];
         std::vector<std::vector<double>> darr2 = r["darr"];
         std::vector<std::vector<bool>> barr2 = r["barr"];
         std::vector<std::vector<std::string>> strarr2 = r["strarr"];
@@ -639,7 +628,6 @@ namespace OCRepresentationEncodingTest
         std::vector<std::vector<OCByteString>> bytestrarr2 = r["bytestrarr"];
 
         EXPECT_EQ(iarr, iarr2);
-        EXPECT_EQ(i64arr, i64arr2);
         EXPECT_EQ(darr, darr2);
         EXPECT_EQ(barr, barr2);
         EXPECT_EQ(strarr, strarr2);
@@ -669,7 +657,6 @@ namespace OCRepresentationEncodingTest
         subRep3.setValue("StringAttr", std::string("String attr"));
 
         std::vector<std::vector<int>> iarr {{1,2,3},{4,6},{7,8,9}};
-        std::vector<std::vector<int64_t>> i64arr {{1LL,2LL,3LL},{4LL,6LL},{7LL,8LL,9LL}};
         std::vector<std::vector<double>> darr {{1.1,2.2,3.3},{4.4,5.5,6.6},{8.8,9.9}};
         std::vector<std::vector<bool>> barr {{false, true}, {false}, {true, true}};
         std::vector<std::vector<std::string>> strarr {{"item1"}, {"item3", "item4"}};
@@ -700,7 +687,6 @@ namespace OCRepresentationEncodingTest
         };
 
         startRep["iarr"] = iarr;
-        startRep["i64arr"] = i64arr;
         startRep["darr"] = darr;
         startRep["barr"] = barr;
         startRep["strarr"] = strarr;
@@ -736,7 +722,6 @@ namespace OCRepresentationEncodingTest
 
         // Test
         std::vector<std::vector<int>> iarr2 = r["iarr"];
-        std::vector<std::vector<int64_t>> i64arr2 = r["i64arr"];
         std::vector<std::vector<double>> darr2 = r["darr"];
         std::vector<std::vector<bool>> barr2 = r["barr"];
         std::vector<std::vector<std::string>> strarr2 = r["strarr"];
@@ -748,7 +733,6 @@ namespace OCRepresentationEncodingTest
         // Since std::vector doesn't require this, items received on the other side end up
         // being backfilled.  This section removes the backfilling
         iarr2[1].pop_back();
-        i64arr2[1].pop_back();
         darr2[2].pop_back();
         barr2[1].pop_back();
         strarr2[0].pop_back();
@@ -756,7 +740,6 @@ namespace OCRepresentationEncodingTest
         bytestrarr2[0].pop_back();
 
         EXPECT_EQ(iarr, iarr2);
-        EXPECT_EQ(i64arr, i64arr2);
         EXPECT_EQ(darr, darr2);
         EXPECT_EQ(barr, barr2);
         EXPECT_EQ(strarr, strarr2);
@@ -786,11 +769,7 @@ namespace OCRepresentationEncodingTest
         subRep3.setValue("StringAttr", std::string("String attr"));
 
         std::vector<std::vector<std::vector<int>>> iarr
-        {{{1,2,3},{4,5,6}},{{7,8,9},{10,11,12}},{{13,14,15},{16,17,18}}};
-        std::vector<std::vector<std::vector<int64_t>>> i64arr
-        {{{1LL,2LL,3LL},{4LL,5LL,6LL}},
-         {{7LL,8LL,9LL},{10LL,11LL,12LL}},{{13LL,14LL,15LL},
-          {16LL,17LL,18LL}}};
+            {{{1,2,3},{4,5,6}},{{7,8,9},{10,11,12}},{{13,14,15},{16,17,18}}};
         std::vector<std::vector<std::vector<double>>> darr
             {{{1.1,2.2,3.3},{4.4,5.5,6.6}},
                 {{7.7,8.7,9.7},{10.7,11.7,12.7}},
@@ -874,7 +853,6 @@ namespace OCRepresentationEncodingTest
         };
 
         startRep["iarr"] = iarr;
-        startRep["i64arr"] = i64arr;
         startRep["darr"] = darr;
         startRep["barr"] = barr;
         startRep["strarr"] = strarr;
@@ -904,7 +882,6 @@ namespace OCRepresentationEncodingTest
 
         // Test
         std::vector<std::vector<std::vector<int>>> iarr2 = r["iarr"];
-        std::vector<std::vector<std::vector<int64_t>>> i64arr2 = r["i64arr"];
         std::vector<std::vector<std::vector<double>>> darr2 = r["darr"];
         std::vector<std::vector<std::vector<bool>>> barr2 = r["barr"];
         std::vector<std::vector<std::vector<std::string>>> strarr2 = r["strarr"];
@@ -912,7 +889,6 @@ namespace OCRepresentationEncodingTest
         std::vector<std::vector<std::vector<OCByteString>>> bytestrarr2 = r["bytestrarr"];
 
         EXPECT_EQ(iarr, iarr2);
-        EXPECT_EQ(i64arr, i64arr2);
         EXPECT_EQ(darr, darr2);
         EXPECT_EQ(barr, barr2);
         EXPECT_EQ(strarr, strarr2);
@@ -945,12 +921,6 @@ namespace OCRepresentationEncodingTest
                 {{7,8,9},{10,12}},
                 {{13,14,15},{16,17,18}}
             };
-        std::vector<std::vector<std::vector<int64_t>>> i64arr
-            {
-                {{1LL,2LL,3LL},{4LL,5LL,6LL}},
-                {{7LL,8LL,9LL},{10LL,12LL}},
-                {{13LL,14LL,15LL},{16LL,17LL,18LL}}
-            };
         std::vector<std::vector<std::vector<double>>> darr
             {
                 {{1.1,2.2,3.3},{4.4,5.5,6.6}},
@@ -1035,7 +1005,6 @@ namespace OCRepresentationEncodingTest
         };
 
         startRep["iarr"] = iarr;
-        startRep["i64arr"] = i64arr;
         startRep["darr"] = darr;
         startRep["barr"] = barr;
         startRep["strarr"] = strarr;
@@ -1065,7 +1034,6 @@ namespace OCRepresentationEncodingTest
 
         // Test
         std::vector<std::vector<std::vector<int>>> iarr2 = r["iarr"];
-        std::vector<std::vector<std::vector<int64_t>>> i64arr2 = r["i64arr"];
         std::vector<std::vector<std::vector<double>>> darr2 = r["darr"];
         std::vector<std::vector<std::vector<bool>>> barr2 = r["barr"];
         std::vector<std::vector<std::vector<std::string>>> strarr2 = r["strarr"];
@@ -1076,7 +1044,6 @@ namespace OCRepresentationEncodingTest
         // Since std::vector doesn't require this, items received on the other side end up
         // being backfilled.  This section removes the backfilling
         iarr2[1][1].pop_back();
-        i64arr2[1][1].pop_back();
         darr2[1][1].pop_back();
         barr2[0][1].pop_back();
         strarr2[1][1].pop_back();
@@ -1085,7 +1052,6 @@ namespace OCRepresentationEncodingTest
         bytestrarr2[1][1].pop_back();
 
         EXPECT_EQ(iarr, iarr2);
-        EXPECT_EQ(i64arr, i64arr2);
         EXPECT_EQ(darr, darr2);
         EXPECT_EQ(barr, barr2);
         EXPECT_EQ(strarr, strarr2);
index 3eb9b2f..b0fc992 100644 (file)
@@ -29,52 +29,6 @@ namespace OCRepresentationTest
     using std::string;
     using std::vector;
 
-    template <typename T>
-    struct ValueToStringParam
-    {
-        ValueToStringParam<T>(const char* expectedString, T expectedValue) :
-            m_expectedString(expectedString),
-            m_expectedValue(expectedValue)
-        {}
-
-        const char* m_expectedString;
-        T m_expectedValue;
-    };
-
-    template <typename T>
-    class OCRepresentationValueToStringTest : public testing::TestWithParam<ValueToStringParam<T>>
-    {
-    public:
-        OCRepresentationValueToStringTest<T>() :
-            m_attributeName("testValueName"),
-            m_expectedString(testing::TestWithParam<ValueToStringParam<T>>::GetParam().m_expectedString),
-            m_expectedValue(testing::TestWithParam<ValueToStringParam<T>>::GetParam().m_expectedValue)
-        {}
-
-        void SetUp()
-        {
-            m_rep.setValue(m_attributeName, m_expectedValue);
-        }
-
-    protected:
-        const char* m_attributeName;
-        const char* m_expectedString;
-        T m_expectedValue;
-        OCRepresentation m_rep;
-    };
-
-    class OCRepresentationInt64ValueToStringTest : public OCRepresentationValueToStringTest<int64_t>
-    {};
-
-    class OCRepresentation1VectorInt64ValueToStringTest : public OCRepresentationValueToStringTest<vector<int64_t>>
-    {};
-
-    class OCRepresentation2VectorInt64ValueToStringTest : public OCRepresentationValueToStringTest<vector<vector<int64_t>>>
-    {};
-
-    class OCRepresentation3VectorInt64ValueToStringTest : public OCRepresentationValueToStringTest<vector<vector<vector<int64_t>>>>
-    {};
-
     void parsedEqual(double expected, const std::string& actualStr)
     {
         double actual = boost::lexical_cast<double>(actualStr);
@@ -116,20 +70,6 @@ namespace OCRepresentationTest
         EXPECT_EQ("54321", rep[AttrName].getValueToString());
     }
 
-    INSTANTIATE_TEST_CASE_P(OCRepresentationInt64ValueToString,
-                            OCRepresentationInt64ValueToStringTest,
-                            ::testing::Values(
-        ValueToStringParam<int64_t>("-1", -1LL),
-        ValueToStringParam<int64_t>("0", 0LL),
-        ValueToStringParam<int64_t>("1", 1LL),
-        ValueToStringParam<int64_t>("9223372036854775807", INT64_MAX),
-        ValueToStringParam<int64_t>("-9223372036854775808", INT64_MIN)));
-    TEST_P(OCRepresentationInt64ValueToStringTest, shouldGetProperInt64String)
-    {
-        EXPECT_EQ(m_expectedString, m_rep.getValueToString(m_attributeName));
-        EXPECT_EQ(m_expectedString, m_rep[m_attributeName].getValueToString());
-    }
-
     TEST(OCRepresentationValueToString, Double)
     {
         static const std::string AttrName = "DoubleTest";
@@ -273,60 +213,6 @@ namespace OCRepresentationTest
         EXPECT_EQ(Expected, rep[AttrName].getValueToString());
     }
 
-    INSTANTIATE_TEST_CASE_P(OCRepresentation1VectorInt64ValueToString,
-                            OCRepresentation1VectorInt64ValueToStringTest,
-                            ::testing::Values(
-        ValueToStringParam<vector<int64_t>>("[-1 ]", {-1LL}),
-        ValueToStringParam<vector<int64_t>>("[1 ]", {1LL}),
-        ValueToStringParam<vector<int64_t>>("[0 ]", {0LL}),
-        ValueToStringParam<vector<int64_t>>("[9223372036854775807 ]", {INT64_MAX}),
-        ValueToStringParam<vector<int64_t>>("[-9223372036854775808 ]", {INT64_MIN}),
-        ValueToStringParam<vector<int64_t>>("[-1 0 9223372036854775807 ]", {-1LL, 0LL, INT64_MAX}),
-        ValueToStringParam<vector<int64_t>>("[-9223372036854775808 1 9223372036854775807 ]", {INT64_MIN, 1, INT64_MAX})));
-    TEST_P(OCRepresentation1VectorInt64ValueToStringTest, shouldGetProper1VectorInt64String)
-    {
-        EXPECT_EQ(m_expectedString, m_rep.getValueToString(m_attributeName));
-        EXPECT_EQ(m_expectedString, m_rep[m_attributeName].getValueToString());
-    }
-
-    INSTANTIATE_TEST_CASE_P(OCRepresentation2VectorInt64ValueToString,
-                            OCRepresentation2VectorInt64ValueToStringTest,
-                            ::testing::Values(
-        ValueToStringParam<vector<vector<int64_t>>>("[[-1 ] ]", {{-1LL}}),
-        ValueToStringParam<vector<vector<int64_t>>>("[[1 ] ]", {{1LL}}),
-        ValueToStringParam<vector<vector<int64_t>>>("[[0 ] ]", {{0LL}}),
-        ValueToStringParam<vector<vector<int64_t>>>("[[9223372036854775807 ] ]", {{INT64_MAX}}),
-        ValueToStringParam<vector<vector<int64_t>>>("[[-9223372036854775808 ] ]", {{INT64_MIN}}),
-        ValueToStringParam<vector<vector<int64_t>>>("[[-1 0 9223372036854775807 ] ]", {{-1LL, 0LL, INT64_MAX}}),
-        ValueToStringParam<vector<vector<int64_t>>>("[[-9223372036854775808 1 9223372036854775807 ] ]", {{INT64_MIN, 1, INT64_MAX}}),
-        ValueToStringParam<vector<vector<int64_t>>>("[[-1 ] [0 9223372036854775807 ] ]", {{-1LL}, {0LL, INT64_MAX}}),
-        ValueToStringParam<vector<vector<int64_t>>>("[[-9223372036854775808 1 ] [9223372036854775807 ] ]", {{INT64_MIN, 1}, {INT64_MAX}})));
-    TEST_P(OCRepresentation2VectorInt64ValueToStringTest, shouldGetProper1VectorInt64String)
-    {
-        EXPECT_EQ(m_expectedString, m_rep.getValueToString(m_attributeName));
-        EXPECT_EQ(m_expectedString, m_rep[m_attributeName].getValueToString());
-    }
-
-    INSTANTIATE_TEST_CASE_P(OCRepresentation3VectorInt64ValueToString,
-                            OCRepresentation3VectorInt64ValueToStringTest,
-                            ::testing::Values(
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[-1 ] ] ]", {{{-1LL}}}),
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[1 ] ] ]", {{{1LL}}}),
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[0 ] ] ]", {{{0LL}}}),
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[9223372036854775807 ] ] ]", {{{INT64_MAX}}}),
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[-9223372036854775808 ] ] ]", {{{INT64_MIN}}}),
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[-1 0 9223372036854775807 ] ] ]", {{{-1LL, 0LL, INT64_MAX}}}),
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[-9223372036854775808 1 9223372036854775807 ] ] ]", {{{INT64_MIN, 1, INT64_MAX}}}),
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[-1 ] [0 9223372036854775807 ] ] ]", {{{-1LL},{0LL, INT64_MAX}}}),
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[-9223372036854775808 1 ] [9223372036854775807 ] ] ]", {{{INT64_MIN, 1},{INT64_MAX}}}),
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[-1 ] ] [[0 ] [9223372036854775807 ] ] ]", {{{-1LL}}, {{0LL}, {INT64_MAX}}}),
-        ValueToStringParam<vector<vector<vector<int64_t>>>>("[[[-9223372036854775808 ] [1 ] ] [[9223372036854775807 ] ] ]", {{{INT64_MIN}, {1}}, {{INT64_MAX}}})));
-    TEST_P(OCRepresentation3VectorInt64ValueToStringTest, shouldGetProper1VectorInt64String)
-    {
-        EXPECT_EQ(m_expectedString, m_rep.getValueToString(m_attributeName));
-        EXPECT_EQ(m_expectedString, m_rep[m_attributeName].getValueToString());
-    }
-
     TEST(OCRepresentationValueToString, DoubleVector)
     {
         static const std::string AttrName = "VectorTest";
@@ -1284,28 +1170,6 @@ namespace OCRepresentationTest
             }
         }
     }
-
-    TEST(OCRepresentationIterator, shouldReturnInt64ValueForAutoIterator)
-    {
-        OCRepresentation rep;
-        const char* expectedName = "int64";
-        int64_t expectedValue = 8;
-
-        ASSERT_TRUE(rep.empty());
-        rep.setValue(expectedName, expectedValue);
-        ASSERT_FALSE(rep.empty());
-        ASSERT_EQ(1, rep.size());
-
-        for (auto& cur : rep)
-        {
-            EXPECT_EQ(expectedName, cur.attrname());
-            EXPECT_EQ(AttributeType::Integer, cur.type());
-            EXPECT_EQ(AttributeType::Integer, cur.base_type());
-            EXPECT_EQ(0u, cur.depth());
-            EXPECT_EQ(expectedValue, cur.getValue<int64_t>());
-        }
-    }
-
     // Iterator usage
     TEST(OCRepresentationIterator, iterator)
     {
@@ -1584,129 +1448,6 @@ namespace OCRepresentationTest
         }
     }
 
-    TEST(OCRepresentationIterator, shouldReturnInt64Depth1VectorForAutoIterator)
-    {
-        OCRepresentation rep;
-        const char* expectedName = "int64v";
-        vector<int64_t> expectedValue = {8};
-
-        ASSERT_TRUE(rep.empty());
-        rep.setValue(expectedName, expectedValue);
-        ASSERT_EQ(1, rep.size());
-
-        for (auto& cur : rep)
-        {
-            EXPECT_EQ(expectedName, cur.attrname());
-            EXPECT_EQ(AttributeType::Vector, cur.type());
-            EXPECT_EQ(AttributeType::Integer, cur.base_type());
-            EXPECT_EQ(1u, cur.depth());
-            EXPECT_EQ(expectedValue, cur.getValue<vector<int64_t>>());
-        }
-    }
-
-    TEST(OCRepresentationIterator, shouldReturnInt64Depth2VectorForAutoIterator)
-    {
-        OCRepresentation rep;
-        const char* expectedName = "int64vv";
-        vector<vector<int64_t>> expectedValue = {{8}};
-
-        ASSERT_TRUE(rep.empty());
-        rep.setValue(expectedName, expectedValue);
-        ASSERT_EQ(1, rep.size());
-
-        for (auto& cur : rep)
-        {
-            EXPECT_EQ(expectedName, cur.attrname());
-            EXPECT_EQ(AttributeType::Vector, cur.type());
-            EXPECT_EQ(AttributeType::Integer, cur.base_type());
-            EXPECT_EQ(2u, cur.depth());
-            EXPECT_EQ(expectedValue, cur.getValue<vector<vector<int64_t>>>());
-        }
-    }
-
-    TEST(OCRepresentationIterator, shouldReturnInt64Depth3VectorForAutoIterator)
-    {
-        OCRepresentation rep;
-        const char* expectedName = "int64vvv";
-        vector<vector<vector<int64_t>>> expectedValue = {{{8}}};
-
-        ASSERT_TRUE(rep.empty());
-        rep.setValue(expectedName, expectedValue);
-        ASSERT_EQ(1, rep.size());
-
-        for (auto& cur : rep)
-        {
-            EXPECT_EQ(expectedName, cur.attrname());
-            EXPECT_EQ(AttributeType::Vector, cur.type());
-            EXPECT_EQ(AttributeType::Integer, cur.base_type());
-            EXPECT_EQ(3u, cur.depth());
-            EXPECT_EQ(expectedValue, cur.getValue<vector<vector<vector<int64_t>>>>());
-        }
-    }
-
-    TEST(OCRepresentationIterator, shouldReturnInt64Depth1VectorForIterator)
-    {
-        OCRepresentation rep;
-        const char* expectedName = "int64v";
-        vector<int64_t> expectedValue = {8};
-
-        ASSERT_TRUE(rep.empty());
-        rep.setValue(expectedName, expectedValue);
-        ASSERT_FALSE(rep.empty());
-        ASSERT_EQ(1, rep.size());
-
-        for (OCRepresentation::iterator cur = rep.begin(); cur != rep.end(); cur++)
-        {
-            EXPECT_EQ(expectedName, cur->attrname());
-            EXPECT_EQ(AttributeType::Vector, cur->type());
-            EXPECT_EQ(AttributeType::Integer, cur->base_type());
-            EXPECT_EQ(1u, cur->depth());
-            EXPECT_EQ(expectedValue, cur->getValue<vector<int64_t>>());
-        }
-    }
-
-    TEST(OCRepresentationIterator, shouldReturnInt64Depth2VectorForIterator)
-    {
-        OCRepresentation rep;
-        const char* expectedName = "int64vv";
-        vector<vector<int64_t>> expectedValue = {{8}};
-
-        ASSERT_TRUE(rep.empty());
-        rep.setValue(expectedName, expectedValue);
-        ASSERT_FALSE(rep.empty());
-        ASSERT_EQ(1, rep.size());
-
-        for (OCRepresentation::iterator cur = rep.begin(); cur != rep.end(); cur++)
-        {
-            EXPECT_EQ(expectedName, cur->attrname());
-            EXPECT_EQ(AttributeType::Vector, cur->type());
-            EXPECT_EQ(AttributeType::Integer, cur->base_type());
-            EXPECT_EQ(2u, cur->depth());
-            EXPECT_EQ(expectedValue, cur->getValue<vector<vector<int64_t>>>());
-        }
-    }
-
-    TEST(OCRepresentationIterator, shouldReturnInt64Depth3VectorForIterator)
-    {
-        OCRepresentation rep;
-        const char* expectedName = "int64vvv";
-        vector<vector<vector<int64_t>>> expectedValue = {{{8}}};
-
-        ASSERT_TRUE(rep.empty());
-        rep.setValue(expectedName, expectedValue);
-        ASSERT_FALSE(rep.empty());
-        ASSERT_EQ(1, rep.size());
-
-        for (OCRepresentation::iterator cur = rep.begin(); cur != rep.end(); cur++)
-        {
-            EXPECT_EQ(expectedName, cur->attrname());
-            EXPECT_EQ(AttributeType::Vector, cur->type());
-            EXPECT_EQ(AttributeType::Integer, cur->base_type());
-            EXPECT_EQ(3u, cur->depth());
-            EXPECT_EQ(expectedValue, cur->getValue<vector<vector<vector<int64_t>>>>());
-        }
-    }
-
     TEST(OCRepresentationHostTest, ValidHost)
     {
         OCDevAddr addr = {OC_DEFAULT_ADAPTER, OC_IP_USE_V6, 5000, "fe80::1%eth0", 0, "", ""};
index 328f110..87d33d6 100644 (file)
@@ -242,8 +242,8 @@ int main()
                     msg.setMediaContents(mediaContents);
 
                     OC::OCRepresentation rep;
-                    rep.setValue("Key1", std::string("Value1"));
-                    rep.setValue("Key2", std::string("Value2"));
+                    rep.setValue("Key1", "Value1");
+                    rep.setValue("Key2", "Value2");
                     msg.setExtraInfo(rep);
 
                     mainMessageId = msg.getMessageId();