You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2017/06/06 17:56:40 UTC
[14/23] geode-native git commit: GEODE-2741: Code cleanup to move to
std::shared_ptr
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityAuthentication.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityAuthentication.cpp b/src/cppcache/integration-test/testThinClientSecurityAuthentication.cpp
index 3de9f27..9a1d2f4 100644
--- a/src/cppcache/integration-test/testThinClientSecurityAuthentication.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityAuthentication.cpp
@@ -37,7 +37,7 @@ CredentialGeneratorPtr credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -64,7 +64,7 @@ void initCredentialGenerator() {
}
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
loopNum++;
@@ -74,7 +74,7 @@ void initCredentialGenerator() {
void initClientAuth(char credentialsType) {
PropertiesPtr config = Properties::create();
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
bool insertAuthInit = true;
switch (credentialsType) {
@@ -129,7 +129,7 @@ DUNIT_TASK_DEFINITION(LOCATORSERVER, CreateServer1)
initCredentialGenerator();
std::string cmdServerAuthenticator;
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
try {
@@ -139,7 +139,7 @@ DUNIT_TASK_DEFINITION(LOCATORSERVER, CreateServer1)
printf("Input to server cmd is --> %s",
cmdServerAuthenticator.c_str());
CacheHelper::initServer(
- 1, NULL, locHostPort,
+ 1, nullptr, locHostPort,
const_cast<char*>(cmdServerAuthenticator.c_str()));
LOG("Server1 started");
}
@@ -257,7 +257,8 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFive)
createRegionForSecurity(regionNamesAuth[1], USE_ACK, true);
RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
CacheableKeyPtr keyPtr = CacheableKey::create(keys[0]);
- auto checkPtr = std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
+ auto checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
if (checkPtr != nullptr && !strcmp(nvals[0], checkPtr->asChar())) {
LOG("checkPtr is not null");
char buf[1024];
@@ -265,7 +266,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFive)
checkPtr->asChar(), keys[0]);
LOG(buf);
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
@@ -386,7 +387,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
LOG("txManager commit done");
CacheableKeyPtr keyPtr = CacheableKey::create("TxKey");
- auto checkPtr = std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
+ auto checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
ASSERT(checkPtr != nullptr, "Value not found.");
LOGINFO("checkPtr->asChar() = %s ", checkPtr->asChar());
ASSERT(strcmp("TxValue", checkPtr->asChar()) == 0, "Value not correct.");
@@ -397,7 +399,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
checkPtr->asChar(), "TxKey");
LOG(buf);
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
txManager->begin();
@@ -407,7 +409,8 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
txManager->rollback();
LOG("txManager rollback done");
- checkPtr = std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
+ checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
ASSERT(checkPtr != nullptr, "Value not found.");
ASSERT(strcmp("TxValue", checkPtr->asChar()) == 0, "Value not correct.");
if (checkPtr != nullptr && !strcmp("TxValue", checkPtr->asChar())) {
@@ -417,7 +420,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
checkPtr->asChar(), "TxKey");
LOG(buf);
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp b/src/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp
index ea2c85e..9ae69aa 100644
--- a/src/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityAuthenticationMU.cpp
@@ -40,7 +40,7 @@ CredentialGeneratorPtr credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -67,7 +67,7 @@ void initCredentialGenerator() {
}
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
loopNum++;
@@ -79,7 +79,7 @@ void initClientAuth(char credentialsType) {
userCreds = Properties::create();
PropertiesPtr config = Properties::create();
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
bool insertAuthInit = true;
switch (credentialsType) {
@@ -136,7 +136,7 @@ DUNIT_TASK_DEFINITION(LOCATORSERVER, CreateServer1)
initCredentialGenerator();
std::string cmdServerAuthenticator;
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
try {
@@ -146,7 +146,7 @@ DUNIT_TASK_DEFINITION(LOCATORSERVER, CreateServer1)
printf("Input to server cmd is --> %s",
cmdServerAuthenticator.c_str());
CacheHelper::initServer(
- 1, NULL, locHostPort,
+ 1, nullptr, locHostPort,
const_cast<char*>(cmdServerAuthenticator.c_str()));
LOG("Server1 started");
}
@@ -198,7 +198,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepOne)
virtualCache->getRegion(regionNamesAuth[0])->put(keys[0], vals[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
FAIL("Should have thrown AuthenticationFailedException.");
} catch (
@@ -232,7 +232,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepTwo)
apache::geode::client::CacheableKey::create(keys[0]));
LOG("Operation allowed.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
@@ -256,7 +256,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepThree)
RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
virtualCache->getRegion(regionNamesAuth[0])->put(keys[0], vals[0]);
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
@@ -287,7 +287,7 @@ DUNIT_TASK_DEFINITION(CLIENT3, StepFour)
RegionServicePtr virtualCache = getVirtualCache(userCreds, pool);
virtualCache->getRegion(regionNamesAuth[0])->put(keys[0], vals[0]);
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
FAIL("Should have thrown AuthenticationRequiredException.");
} catch (
@@ -321,7 +321,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFive)
virtualCache = getVirtualCache(userCreds, pool);
virtualRegion = virtualCache->getRegion(regionNamesAuth[1]);
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
CacheableKeyPtr keyPtr = CacheableKey::create(keys[0]);
LOG("before get");
@@ -334,7 +334,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepFive)
checkPtr->asChar(), keys[0]);
LOG(buf);
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
@@ -361,7 +361,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepSix)
virtualRegion->put(keys[0], nvals[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
@@ -397,7 +397,7 @@ DUNIT_TASK_DEFINITION(CLIENT2, StepSeven)
virtualRegion->put(keys[0], nvals[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
FAIL("Should have thrown AuthenticationFailedException.");
} catch (
@@ -427,7 +427,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
virtualCache = getVirtualCache(userCreds, pool);
virtualRegion = virtualCache->getRegion(regionNamesAuth[1]);
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
CacheTransactionManagerPtr txManager =
@@ -452,7 +452,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
checkPtr->asChar(), "TxKey");
LOG(buf);
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
txManager->begin();
@@ -473,7 +473,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepEight)
checkPtr->asChar(), "TxKey");
LOG(buf);
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityAuthorization.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityAuthorization.cpp b/src/cppcache/integration-test/testThinClientSecurityAuthorization.cpp
index 6049dec..d90604b 100644
--- a/src/cppcache/integration-test/testThinClientSecurityAuthorization.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityAuthorization.cpp
@@ -36,7 +36,7 @@ CredentialGeneratorPtr credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -63,7 +63,7 @@ void initCredentialGenerator() {
}
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
loopNum++;
@@ -124,13 +124,16 @@ void initClientAuth(char UserType) {
credentialGeneratorHandler->getAuthInit(config);
switch (UserType) {
case 'W':
- credentialGeneratorHandler->getAllowedCredentialsForOps(wr, config, NULL);
+ credentialGeneratorHandler->getAllowedCredentialsForOps(wr, config,
+ nullptr);
break;
case 'R':
- credentialGeneratorHandler->getAllowedCredentialsForOps(rt, config, NULL);
+ credentialGeneratorHandler->getAllowedCredentialsForOps(rt, config,
+ nullptr);
break;
case 'A':
- credentialGeneratorHandler->getAllowedCredentialsForOps(ad, config, NULL);
+ credentialGeneratorHandler->getAllowedCredentialsForOps(ad, config,
+ nullptr);
default:
break;
}
@@ -233,7 +236,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
HashMapOfCacheable entrymap;
entrymap.clear();
for (int i = 0; i < 5; i++) {
- entrymap.insert(CacheableKey::create(i), CacheableInt32::create(i));
+ entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
regPtr->putAll(entrymap);
@@ -338,7 +341,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HashMapOfCacheable entrymap;
entrymap.clear();
for (int i = 0; i < 5; i++) {
- entrymap.insert(CacheableKey::create(i), CacheableInt32::create(i));
+ entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
regPtr->putAll(entrymap);
@@ -371,7 +374,8 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
try {
RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
CacheableKeyPtr keyPtr = CacheableKey::create(keys[2]);
- auto checkPtr = std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
+ auto checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
if (checkPtr != nullptr) {
char buf[1024];
sprintf(buf, "In net search, get returned %s for key %s",
@@ -379,7 +383,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
LOG(buf);
FAIL("Should not get the value");
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
@@ -502,14 +506,15 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
try {
RegionPtr regPtr0 = getHelper()->getRegion(regionNamesAuth[0]);
CacheableKeyPtr keyPtr = CacheableKey::create(keys[2]);
- auto checkPtr = std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
+ auto checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(regPtr0->get(keyPtr));
if (checkPtr != nullptr) {
char buf[1024];
sprintf(buf, "In net search, get returned %s for key %s",
checkPtr->asChar(), keys[2]);
LOG(buf);
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
}
HANDLE_NO_NOT_AUTHORIZED_EXCEPTION
@@ -537,7 +542,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
HashMapOfCacheable entrymap;
entrymap.clear();
for (int i = 0; i < 5; i++) {
- entrymap.insert(CacheableKey::create(i), CacheableInt32::create(i));
+ entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
regPtr0->putAll(entrymap);
FAIL("PutAll should not have completed successfully");
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp b/src/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp
index e4ab9d6..0463a7b 100644
--- a/src/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityAuthorizationMU.cpp
@@ -39,7 +39,7 @@ char* exFuncNameSendException = (char*)"executeFunction_SendException";
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -66,7 +66,7 @@ void initCredentialGenerator() {
}
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
loopNum++;
@@ -130,15 +130,15 @@ void initClientAuth(char UserType) {
switch (UserType) {
case 'W':
credentialGeneratorHandler->getAllowedCredentialsForOps(wr, userCreds,
- NULL);
+ nullptr);
break;
case 'R':
credentialGeneratorHandler->getAllowedCredentialsForOps(rt, userCreds,
- NULL);
+ nullptr);
break;
case 'A':
credentialGeneratorHandler->getAllowedCredentialsForOps(ad, userCreds,
- NULL);
+ nullptr);
default:
break;
}
@@ -231,7 +231,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
//---------------------for region clear tests-----
@@ -256,7 +256,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
HashMapOfCacheable entrymap;
entrymap.clear();
for (int i = 0; i < 5; i++) {
- entrymap.insert(CacheableKey::create(i), CacheableInt32::create(i));
+ entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
// RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
regionPtr->putAll(entrymap);
@@ -373,24 +373,24 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
// UNUSED bool getResult = true;
ExecutionPtr funcExec = FunctionService::onRegion(regionPtr);
- ASSERT(funcExec != nullptr, "onRegion Returned NULL");
+ ASSERT(funcExec != nullptr, "onRegion Returned nullptr");
ResultCollectorPtr collector =
funcExec->withArgs(args)->withFilter(filter)->execute(
exFuncNameSendException, 15);
- ASSERT(collector != nullptr, "onRegion collector NULL");
+ ASSERT(collector != nullptr, "onRegion collector nullptr");
CacheableVectorPtr result = collector->getResult();
if (result == nullptr) {
- ASSERT(false, "echo String : result is NULL");
+ ASSERT(false, "echo String : result is nullptr");
} else {
try {
for (int i = 0; i < result->size(); i++) {
auto uFEPtr =
std::dynamic_pointer_cast<UserFunctionExecutionException>(
result->operator[](i));
- ASSERT(uFEPtr != nullptr, "uFEPtr exception is NULL");
+ ASSERT(uFEPtr != nullptr, "uFEPtr exception is nullptr");
LOGINFO("Done casting to uFEPtr");
LOGINFO("Read expected uFEPtr exception %s ",
uFEPtr->getMessage()->asChar());
@@ -416,7 +416,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
collector = funcExec->withArgs(arrList)->withFilter(filter)->execute(
exFuncNameSendException, 15);
- ASSERT(collector != nullptr, "onRegion collector for arrList NULL");
+ ASSERT(collector != nullptr, "onRegion collector for arrList nullptr");
result = collector->getResult();
ASSERT(result->size() == arrList->size() + 1,
@@ -427,7 +427,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
try {
auto intValue = std::dynamic_pointer_cast<CacheableInt32>(
result->operator[](i));
- ASSERT(intValue != nullptr, "int value is NULL");
+ ASSERT(intValue != nullptr, "int value is nullptr");
LOGINFO("intValue is %d ", intValue->value());
} catch (ClassCastException& ex) {
LOG("exFuncNameSendException casting to int for arrayList "
@@ -442,7 +442,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
auto uFEPtr =
std::dynamic_pointer_cast<UserFunctionExecutionException>(
result->operator[](i));
- ASSERT(uFEPtr != nullptr, "uFEPtr exception is NULL");
+ ASSERT(uFEPtr != nullptr, "uFEPtr exception is nullptr");
LOGINFO("Done casting to uFEPtr");
LOGINFO("Read expected uFEPtr exception %s ",
uFEPtr->getMessage()->asChar());
@@ -488,7 +488,7 @@ DUNIT_TASK_DEFINITION(ADMIN_CLIENT, StepOne)
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
LOG("Region created successfully");
@@ -537,7 +537,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
// createEntry( regionNamesAuth[0], keys[0], vals[0] );
@@ -549,7 +549,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
HashMapOfCacheable entrymap;
entrymap.clear();
for (int i = 0; i < 5; i++) {
- entrymap.insert(CacheableKey::create(i), CacheableInt32::create(i));
+ entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
// RegionPtr regPtr = getHelper()->getRegion(regionNamesAuth[0]);
regionPtr->putAll(entrymap);
@@ -582,7 +582,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
virtualCache = getVirtualCache(userCreds, pool);
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
LOG("GetServerKeys check started for WRITER");
VectorOfCacheableKey keysvec;
@@ -605,7 +605,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
CacheableKeyPtr keyPtr = CacheableKey::create(keys[2]);
auto checkPtr =
@@ -617,7 +617,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
LOG(buf);
FAIL("Should not get the value");
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
}
HANDLE_NOT_AUTHORIZED_EXCEPTION
@@ -642,7 +642,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
/* for (int i=0; i<5; i++) {
@@ -673,7 +673,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
regionPtr->query("1=1");
FAIL("Query should not have completed successfully");
@@ -864,7 +864,7 @@ DUNIT_TASK_DEFINITION(WRITER_CLIENT, StepTwo)
regionPtr = virtualCache->getRegion(regionNamesAuth[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
// createEntry( regionNamesAuth[0], keys[2], vals[2] );
@@ -895,7 +895,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
rptr = virtualCache->getRegion(regionNamesAuth[0]);
LOG("Operation allowed, something is wrong.");
} else {
- LOG("Pool is NULL");
+ LOG("Pool is nullptr");
}
// rptr = getHelper()->getRegion(regionNamesAuth[0]);
@@ -952,7 +952,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
checkPtr->asChar(), keys[2]);
LOG(buf);
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
}
HANDLE_NO_NOT_AUTHORIZED_EXCEPTION
@@ -972,7 +972,7 @@ DUNIT_TASK_DEFINITION(READER_CLIENT, StepThree)
HashMapOfCacheable entrymap;
entrymap.clear();
for (int i = 0; i < 5; i++) {
- entrymap.insert(CacheableKey::create(i), CacheableInt32::create(i));
+ entrymap.emplace(CacheableKey::create(i), CacheableInt32::create(i));
}
rptr->putAll(entrymap);
FAIL("PutAll should not have completed successfully");
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityCQAuthorization.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityCQAuthorization.cpp b/src/cppcache/integration-test/testThinClientSecurityCQAuthorization.cpp
index 14cccc9..3692041 100644
--- a/src/cppcache/integration-test/testThinClientSecurityCQAuthorization.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityCQAuthorization.cpp
@@ -130,7 +130,7 @@ class MyCqListener : public CqListener {
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -141,7 +141,7 @@ void initCredentialGenerator() {
credentialGeneratorHandler = CredentialGenerator::create("DUMMY3");
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
}
@@ -159,7 +159,7 @@ void initClientCq(const bool isthinClient) {
credentialGeneratorHandler->getAuthInit(config);
credentialGeneratorHandler->getValidCredentials(config);
- if (cacheHelper == NULL) {
+ if (cacheHelper == nullptr) {
cacheHelper = new CacheHelper(isthinClient, config);
}
ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
@@ -432,7 +432,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, StepFour)
excp.printStackTrace();
}
auto serviceStats = qs->getCqServiceStatistics();
- ASSERT(serviceStats != nullptr, "serviceStats is NULL");
+ ASSERT(serviceStats != nullptr, "serviceStats is nullptr");
sprintf(buf,
"numCqsActive=%d, numCqsCreated=%d, "
"numCqsClosed=%d,numCqsStopped=%d, numCqsOnClient=%d",
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp b/src/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp
index aac3381..39d5bb7 100644
--- a/src/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityCQAuthorizationMU.cpp
@@ -134,7 +134,7 @@ class MyCqListener : public CqListener {
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -145,7 +145,7 @@ void initCredentialGenerator() {
credentialGeneratorHandler = CredentialGenerator::create("DUMMY3");
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
}
@@ -163,7 +163,7 @@ void initClientCq(const bool isthinClient) {
// credentialGeneratorHandler->getAuthInit(config);
credentialGeneratorHandler->getValidCredentials(userCreds);
- if (cacheHelper == NULL) {
+ if (cacheHelper == nullptr) {
cacheHelper = new CacheHelper(isthinClient, config);
}
ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
@@ -179,7 +179,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateServer1)
"authenticator:authorizer:authorizerPP", getXmlPath());
printf("string %s", cmdServerAuthenticator.c_str());
CacheHelper::initServer(
- 1, "remotequery.xml", NULL,
+ 1, "remotequery.xml", nullptr,
const_cast<char*>(cmdServerAuthenticator.c_str()));
LOG("Server1 started");
}
@@ -195,7 +195,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateServer2)
"authenticator:authorizer:authorizerPP", getXmlPath());
printf("string %s", cmdServerAuthenticator.c_str());
CacheHelper::initServer(
- 2, "remotequery2.xml", NULL,
+ 2, "remotequery2.xml", nullptr,
const_cast<char*>(cmdServerAuthenticator.c_str()));
LOG("Server2 started");
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityDH.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityDH.cpp b/src/cppcache/integration-test/testThinClientSecurityDH.cpp
index 943b4ac..fb2b142 100644
--- a/src/cppcache/integration-test/testThinClientSecurityDH.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityDH.cpp
@@ -64,7 +64,7 @@ CredentialGeneratorPtr credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -94,7 +94,7 @@ void initCredentialGenerator() {
}
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
loopNum++;
@@ -114,7 +114,7 @@ void initClientAuth(char credentialsType, const char* dhAlgo) {
config->insert("security-client-kspath", testsrc.c_str());
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
bool insertAuthInit = true;
switch (credentialsType) {
@@ -202,7 +202,7 @@ void DoNetSearch() {
checkPtr->asChar(), keys[0]);
LOG(buf);
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
@@ -214,7 +214,7 @@ void DoNetSearch() {
void initSecurityServer(int instance) {
std::string cmdServerAuthenticator;
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
try {
@@ -242,7 +242,7 @@ void initSecurityServer(int instance) {
printf("Input to server cmd is --> %s\n",
cmdServerAuthenticator.c_str());
CacheHelper::initServer(
- instance, NULL, locHostPort,
+ instance, nullptr, locHostPort,
const_cast<char*>(cmdServerAuthenticator.c_str()));
}
} catch (...) {
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityDH_MU.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityDH_MU.cpp b/src/cppcache/integration-test/testThinClientSecurityDH_MU.cpp
index 52f067f..c98f510 100644
--- a/src/cppcache/integration-test/testThinClientSecurityDH_MU.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityDH_MU.cpp
@@ -67,7 +67,7 @@ CredentialGeneratorPtr credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -97,7 +97,7 @@ void initCredentialGenerator() {
}
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
loopNum++;
@@ -120,7 +120,7 @@ void initClientAuth(char credentialsType, const char* dhAlgo) {
config->insert("security-client-kspath", testsrc.c_str());
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
bool insertAuthInit = true;
switch (credentialsType) {
@@ -225,7 +225,8 @@ void DoNetSearch() {
RegionPtr regionPtr = virtualCache->getRegion(regionNamesAuth[1]);
CacheableKeyPtr keyPtr = CacheableKey::create(keys[0]);
- auto checkPtr = std::dynamic_pointer_cast<CacheableString>(regionPtr->get(keyPtr));
+ auto checkPtr =
+ std::dynamic_pointer_cast<CacheableString>(regionPtr->get(keyPtr));
if (checkPtr != nullptr && !strcmp(vals[0], checkPtr->asChar())) {
LOG("checkPtr is not null");
char buf[1024];
@@ -233,7 +234,7 @@ void DoNetSearch() {
checkPtr->asChar(), keys[0]);
LOG(buf);
} else {
- LOG("checkPtr is NULL");
+ LOG("checkPtr is nullptr");
}
} catch (const apache::geode::client::Exception& other) {
other.printStackTrace();
@@ -245,7 +246,7 @@ void DoNetSearch() {
void initSecurityServer(int instance) {
std::string cmdServerAuthenticator;
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
try {
@@ -273,7 +274,7 @@ void initSecurityServer(int instance) {
printf("Input to server cmd is --> %s\n",
cmdServerAuthenticator.c_str());
CacheHelper::initServer(
- instance, NULL, locHostPort,
+ instance, nullptr, locHostPort,
const_cast<char*>(cmdServerAuthenticator.c_str()));
}
} catch (...) {
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp b/src/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp
index 59224aa..8655d61 100644
--- a/src/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityDurableCQAuthorizationMU.cpp
@@ -134,7 +134,7 @@ class MyCqListener : public CqListener {
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -145,7 +145,7 @@ void initCredentialGenerator() {
credentialGeneratorHandler = CredentialGenerator::create("DUMMY3");
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
}
@@ -168,7 +168,7 @@ void initClientCq(const bool isthinClient, int clientIdx) {
config->insert("durable-timeout", 60);
config->insert("notify-ack-interval", 1);
- if (cacheHelper == NULL) {
+ if (cacheHelper == nullptr) {
cacheHelper = new CacheHelper(isthinClient, config);
}
ASSERT(cacheHelper, "Failed to create a CacheHelper client instance.");
@@ -188,7 +188,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateServer1)
"authenticator:authorizerPP", getXmlPath());
printf("string %s", cmdServerAuthenticator.c_str());
CacheHelper::initServer(
- 1, "remotequery.xml", NULL,
+ 1, "remotequery.xml", nullptr,
const_cast<char*>(cmdServerAuthenticator.c_str()));
LOG("Server1 started");
}
@@ -204,7 +204,7 @@ DUNIT_TASK_DEFINITION(CLIENT1, CreateServer2)
"authenticator:authorizerPP", getXmlPath());
printf("string %s", cmdServerAuthenticator.c_str());
CacheHelper::initServer(
- 2, "remotequery2.xml", NULL,
+ 2, "remotequery2.xml", nullptr,
const_cast<char*>(cmdServerAuthenticator.c_str()));
LOG("Server2 started");
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp b/src/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp
index 75ec233..42327fb 100644
--- a/src/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityMultiUserTest.cpp
@@ -41,7 +41,7 @@ std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
printf(" getXMLPATH = %s \n", path);
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -68,7 +68,7 @@ void initCredentialGenerator() {
}
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
loopNum++;
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp b/src/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
index cea188d..7b51737 100644
--- a/src/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
+++ b/src/cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
@@ -108,17 +108,17 @@ const char* getServerSecurityParams() {
char* ldapSrv = ACE_OS::getenv("LDAP_SERVER");
serverSecurityParams += std::string(" security-ldap-server=") +
- (ldapSrv != NULL ? ldapSrv : "ldap");
+ (ldapSrv != nullptr ? ldapSrv : "ldap");
char* ldapRoot = ACE_OS::getenv("LDAP_BASEDN");
serverSecurityParams +=
std::string(" security-ldap-basedn=") +
- (ldapRoot != NULL ? ldapRoot
- : "ou=ldapTesting,dc=ldap,dc=apache,dc=org");
+ (ldapRoot != nullptr ? ldapRoot
+ : "ou=ldapTesting,dc=ldap,dc=apache,dc=org");
char* ldapSSL = ACE_OS::getenv("LDAP_USESSL");
serverSecurityParams += std::string(" security-ldap-usessl=") +
- (ldapSSL != NULL ? ldapSSL : "false");
+ (ldapSSL != nullptr ? ldapSSL : "false");
}
return serverSecurityParams.c_str();
}
@@ -138,13 +138,13 @@ void checkValuesMap(const HashMapOfCacheablePtr& values, int clientNum,
for (int index = clientNum - 1; index < numKeys; index += clientNum) {
++expectedNum;
key = CacheableString::create(keys[index]);
- HashMapOfCacheable::Iterator iter = values->find(key);
+ const auto& iter = values->find(key);
ASSERT(iter != values->end(), "key not found in values map");
- val = std::dynamic_pointer_cast<CacheableString>(iter.second());
+ val = std::dynamic_pointer_cast<CacheableString>(iter->second);
expectedVal = CacheableString::create(nvals[index]);
ASSERT(*val == *expectedVal, "unexpected value in values map");
}
- printf("Expected number of values: %d; got values: %d", expectedNum,
+ printf("Expected number of values: %d; got values: %zd", expectedNum,
values->size());
ASSERT(values->size() == expectedNum, "unexpected number of values");
}
@@ -157,16 +157,15 @@ void checkExceptionsMap(const HashMapOfExceptionPtr& exceptions, int clientNum,
if ((index + 1) % clientNum != 0) {
++expectedNum;
key = CacheableString::create(keys[index]);
- HashMapOfException::Iterator iter = exceptions->find(key);
+ const auto& iter = exceptions->find(key);
ASSERT(iter != exceptions->end(), "key not found in exceptions map");
- ASSERT(
- std::dynamic_pointer_cast<NotAuthorizedExceptionPtr>(iter.second()),
- "unexpected exception type in exception map");
+ ASSERT(std::dynamic_pointer_cast<NotAuthorizedExceptionPtr>(iter->second),
+ "unexpected exception type in exception map");
printf("Got expected NotAuthorizedException: %s",
- iter.second()->getMessage());
+ iter->second->getMessage());
}
}
- printf("Expected number of exceptions: %d; got exceptions: %d", expectedNum,
+ printf("Expected number of exceptions: %d; got exceptions: %zd", expectedNum,
exceptions->size());
ASSERT(exceptions->size() == expectedNum, "unexpected number of exceptions");
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientStatistics.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientStatistics.cpp b/src/cppcache/integration-test/testThinClientStatistics.cpp
index ec9e1d0..461a09f 100644
--- a/src/cppcache/integration-test/testThinClientStatistics.cpp
+++ b/src/cppcache/integration-test/testThinClientStatistics.cpp
@@ -177,7 +177,7 @@ void DoRegionOpsAndVerify() {
"regionEntry is not destroyed, remRegEntry->isDestroyed must return "
"false");
} else {
- LOGINFO("regionEntry pointer for removed key is NULL");
+ LOGINFO("regionEntry pointer for removed key is nullptr");
}
auto cacheStatptr = std::make_shared<CacheStatistics>();
@@ -201,7 +201,7 @@ void DoRegionOpsAndVerify() {
if (cacheStatptr != nullptr) {
LOGINFO("LastAccessedTime = %d ", cacheStatptr->getLastAccessedTime());
} else {
- LOGINFO("cacheStatptr is NULL");
+ LOGINFO("cacheStatptr is nullptr");
}
}
@@ -237,7 +237,7 @@ void createType(StatisticsFactory* statFactory, TestStatisticsType& testType) {
StatisticsType* statsType = statFactory->createType(
"TestStatsType", "Statistics for Unit Test.", statDescriptorArr, 6);
- ASSERT(statsType != NULL, "Error in creating Stats Type");
+ ASSERT(statsType != nullptr, "Error in creating Stats Type");
testType.testStatsType = statsType;
testType.statIdIntCounter = statsType->nameToId("IntCounter");
@@ -331,7 +331,7 @@ void statisticsTest() {
/* Create a statistics */
Statistics* testStat1 =
factory->createStatistics(testType.testStatsType, "TestStatistics");
- ASSERT(testStat1 != NULL, "Test Statistics Creation Failed");
+ ASSERT(testStat1 != nullptr, "Test Statistics Creation Failed");
/* Tests Find Type , Find Statistics */
Statistics* temp = factory->findFirstStatisticsByType(testType.testStatsType);
@@ -346,7 +346,7 @@ void statisticsTest() {
testStat1->close();
Statistics* temp2 =
factory->findFirstStatisticsByType(testType.testStatsType);
- ASSERT(temp2 == NULL, "Statistics close() Failed");
+ ASSERT(temp2 == nullptr, "Statistics close() Failed");
LOG("StatisticsTest Completed");
}
@@ -404,8 +404,8 @@ void StatFileTest() {
/* Test if this file Stat-pid.gfs is there */
FILE* fp = fopen(statFilename.c_str(), "r");
- ASSERT(fp != NULL, "Statistics GFS file does not exist");
- if (fp != NULL) {
+ ASSERT(fp != nullptr, "Statistics GFS file does not exist");
+ if (fp != nullptr) {
LOG("SUCCESS: .gfs file exist.");
fclose(fp);
}
@@ -527,24 +527,14 @@ DUNIT_TASK_DEFINITION(SERVER1, CloseThirdServer)
END_TASK_DEFINITION
DUNIT_MAIN
- {
- CALL_TASK(CreateLocator1)
-
- CALL_TASK(StartFirstServer)
- CALL_TASK(ClientFirstInit)
- CALL_TASK(StatTest)
- CALL_TASK(CloseFirstClient)
- CALL_TASK(GFSFileTest)
- CALL_TASK(CloseFirstServer)
- CALL_TASK(StartSecondServer)
- CALL_TASK(ClientSecondInit)
- CALL_TASK(CloseSecondServer)
- CALL_TASK(StartThirdServer)
- CALL_TASK(ClientThirdInit)
- CALL_TASK(RegionOps)
- CALL_TASK(CloseThirdClient)
- CALL_TASK(CloseThirdServer)
-
- CALL_TASK(CloseLocator1)
- }
-END_MAIN
+{CALL_TASK(CreateLocator1)
+
+ CALL_TASK(StartFirstServer) CALL_TASK(ClientFirstInit) CALL_TASK(StatTest)
+ CALL_TASK(CloseFirstClient) CALL_TASK(GFSFileTest)
+ CALL_TASK(CloseFirstServer) CALL_TASK(StartSecondServer)
+ CALL_TASK(ClientSecondInit) CALL_TASK(CloseSecondServer)
+ CALL_TASK(StartThirdServer) CALL_TASK(ClientThirdInit)
+ CALL_TASK(RegionOps) CALL_TASK(CloseThirdClient)
+ CALL_TASK(CloseThirdServer)
+
+ CALL_TASK(CloseLocator1)} END_MAIN
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientTicket304.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientTicket304.cpp b/src/cppcache/integration-test/testThinClientTicket304.cpp
index 8fd7081..d19758d 100644
--- a/src/cppcache/integration-test/testThinClientTicket304.cpp
+++ b/src/cppcache/integration-test/testThinClientTicket304.cpp
@@ -25,7 +25,7 @@
// This is the test for tracking work. bug#304
-putThread *thread1 = NULL;
+putThread *thread1 = nullptr;
void createAuthzRegion() {
initCredentialGenerator();
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientTracking.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientTracking.cpp b/src/cppcache/integration-test/testThinClientTracking.cpp
index 9f8c0db..b39eb2b 100644
--- a/src/cppcache/integration-test/testThinClientTracking.cpp
+++ b/src/cppcache/integration-test/testThinClientTracking.cpp
@@ -25,8 +25,8 @@
// This is the test for tracking work.
-putThread *thread1 = NULL;
-putThread *thread2 = NULL;
+putThread *thread1 = nullptr;
+putThread *thread2 = nullptr;
void createAuthzRegion() {
initCredentialGenerator();
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testThinClientWriterException.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testThinClientWriterException.cpp b/src/cppcache/integration-test/testThinClientWriterException.cpp
index ded57fa..6015536 100644
--- a/src/cppcache/integration-test/testThinClientWriterException.cpp
+++ b/src/cppcache/integration-test/testThinClientWriterException.cpp
@@ -47,7 +47,7 @@ CredentialGeneratorPtr credentialGeneratorHandler;
std::string getXmlPath() {
char xmlPath[1000] = {'\0'};
const char* path = ACE_OS::getenv("TESTSRC");
- ASSERT(path != NULL,
+ ASSERT(path != nullptr,
"Environment variable TESTSRC for test source directory is not set.");
strncpy(xmlPath, path, strlen(path) - strlen("cppcache"));
strcat(xmlPath, "xml/Security/");
@@ -74,7 +74,7 @@ void initCredentialGenerator() {
}
if (credentialGeneratorHandler == nullptr) {
- FAIL("credentialGeneratorHandler is NULL");
+ FAIL("credentialGeneratorHandler is nullptr");
}
loopNum++;
@@ -108,7 +108,7 @@ void initClientAuth() {
PropertiesPtr config = Properties::create();
opCodeList rt(tmpRArr, tmpRArr + sizeof tmpRArr / sizeof *tmpRArr);
credentialGeneratorHandler->getAuthInit(config);
- credentialGeneratorHandler->getAllowedCredentialsForOps(rt, config, NULL);
+ credentialGeneratorHandler->getAllowedCredentialsForOps(rt, config, nullptr);
printf("User is %s Pass is %s ", config->find("security-username")->asChar(),
(config->find("security-password") != nullptr
? config->find("security-password")->asChar()
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testUtils.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testUtils.hpp b/src/cppcache/integration-test/testUtils.hpp
index b5b59b8..d1a6d3f 100644
--- a/src/cppcache/integration-test/testUtils.hpp
+++ b/src/cppcache/integration-test/testUtils.hpp
@@ -55,11 +55,11 @@ class TestUtils {
return CacheRegionHelper::getCacheImpl(cptr.get());
}
- static int testGetNumberOfPdxIds() {
+ static size_t testGetNumberOfPdxIds() {
return PdxTypeRegistry::testGetNumberOfPdxIds();
}
- static int testNumberOfPreservedData() {
+ static size_t testNumberOfPreservedData() {
return PdxTypeRegistry::testNumberOfPreservedData();
}
@@ -132,14 +132,14 @@ class TestUtils {
}
VectorOfCacheableKey v;
rptr->keys(v);
- uint32_t len = v.size();
- sprintf(buf, "Total keys in region %s : %u\n", rptr->getName(), len);
+ auto len = v.size();
+ sprintf(buf, "Total keys in region %s : %zu\n", rptr->getName(), len);
LOG(buf);
for (uint32_t i = 0; i < len; i++) {
char keyText[100];
v[i]->logString(keyText, 100);
sprintf(buf, "key[%u] = '%s'\n", i,
- (v[i] == nullptr) ? "NULL KEY" : keyText);
+ (v[i] == nullptr) ? "nullptr KEY" : keyText);
LOG(buf);
}
}
@@ -152,8 +152,8 @@ class TestUtils {
}
VectorOfCacheableKey v;
rptr->keys(v);
- uint32_t len = v.size();
- sprintf(buf, "Total keys in region %s : %u\n", rptr->getName(), len);
+ auto len = v.size();
+ sprintf(buf, "Total keys in region %s : %zu\n", rptr->getName(), len);
LOG(buf);
for (uint32_t i = 0; i < len; i++) {
CacheableKeyPtr keyPtr = v[i];
@@ -162,7 +162,7 @@ class TestUtils {
auto valPtr =
std::dynamic_pointer_cast<CacheableString>(rptr->get(keyPtr));
sprintf(buf, "key[%u] = '%s', value[%u]='%s'\n", i,
- (keyPtr == nullptr) ? "NULL KEY" : keyText, i,
+ (keyPtr == nullptr) ? "nullptr KEY" : keyText, i,
(valPtr == nullptr) ? "NULL_VALUE" : valPtr->asChar());
LOG(buf);
}
@@ -176,13 +176,13 @@ class TestUtils {
}
VectorOfCacheable v;
rptr->values(v);
- uint32_t len = v.size();
- sprintf(buf, "Total values in region %s : %u\n", rptr->getName(), len);
+ auto len = v.size();
+ sprintf(buf, "Total values in region %s : %zu\n", rptr->getName(), len);
LOG(buf);
- for (uint32_t i = 0; i < len; i++) {
+ for (size_t i = 0; i < len; i++) {
auto value = std::dynamic_pointer_cast<CacheableString>(v[i]);
- sprintf(buf, "value[%u] = '%s'\n", i,
- (value == nullptr) ? "NULL VALUE" : value->asChar());
+ sprintf(buf, "value[%zu] = '%s'\n", i,
+ (value == nullptr) ? "nullptr VALUE" : value->asChar());
LOG(buf);
}
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/integration-test/testXmlCacheCreationWithPools.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/testXmlCacheCreationWithPools.cpp b/src/cppcache/integration-test/testXmlCacheCreationWithPools.cpp
index 337a2e5..89d18b6 100644
--- a/src/cppcache/integration-test/testXmlCacheCreationWithPools.cpp
+++ b/src/cppcache/integration-test/testXmlCacheCreationWithPools.cpp
@@ -32,7 +32,7 @@
static bool isLocalServer = false;
static bool isLocator = false;
static int numberOfLocators = 1;
-const char* endPoints = (const char*)NULL;
+const char* endPoints = (const char*)nullptr;
const char* locatorsG =
CacheHelper::getLocatorHostPort(isLocator, isLocalServer, numberOfLocators);
@@ -83,7 +83,7 @@ bool checkPoolAttribs(PoolPtr pool, SLIST& locators, SLIST& servers,
char logmsg[500] = {0};
if (pool == nullptr) {
- LOG("checkPoolAttribs: PoolPtr is NULL");
+ LOG("checkPoolAttribs: PoolPtr is nullptr");
return false;
}
@@ -91,7 +91,7 @@ bool checkPoolAttribs(PoolPtr pool, SLIST& locators, SLIST& servers,
if (strcmp(pool->getName(), name)) {
sprintf(logmsg, "checkPoolAttribs: Pool name expected [%s], actual [%s]",
- name, pool->getName() == NULL ? "null" : pool->getName());
+ name, pool->getName() == nullptr ? "null" : pool->getName());
LOG(logmsg);
return false;
}
@@ -162,10 +162,10 @@ bool checkPoolAttribs(PoolPtr pool, SLIST& locators, SLIST& servers,
return false;
}
if (strcmp(serverGroup, pool->getServerGroup())) {
- sprintf(logmsg,
- "checkPoolAttribs: Pool serverGroup expected [%s], actual [%s]",
- serverGroup,
- pool->getServerGroup() == NULL ? "null" : pool->getServerGroup());
+ sprintf(
+ logmsg, "checkPoolAttribs: Pool serverGroup expected [%s], actual [%s]",
+ serverGroup,
+ pool->getServerGroup() == nullptr ? "null" : pool->getServerGroup());
LOG(logmsg);
return false;
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/AdminRegion.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/AdminRegion.cpp b/src/cppcache/src/AdminRegion.cpp
index 271fd66..3d21b0a 100644
--- a/src/cppcache/src/AdminRegion.cpp
+++ b/src/cppcache/src/AdminRegion.cpp
@@ -58,7 +58,7 @@ void AdminRegion::init() {
*/
// Init distribution manager if it is not a pool
ThinClientPoolDM* pool = dynamic_cast<ThinClientPoolDM*>(m_distMngr);
- if (pool == NULL) {
+ if (pool == nullptr) {
m_distMngr->init();
}
}
@@ -78,7 +78,7 @@ GfErrType AdminRegion::putNoThrow(const CacheableKeyPtr& keyPtr,
// put obj to region
GfErrType err = GF_NOERR;
- TcrMessagePut request(NULL, keyPtr, valuePtr, nullptr, false, m_distMngr,
+ TcrMessagePut request(nullptr, keyPtr, valuePtr, nullptr, false, m_distMngr,
true, false, m_fullPath.c_str());
request.setMetaRegion(true);
TcrMessageReply reply(true, m_distMngr);
@@ -126,7 +126,7 @@ void AdminRegion::close() {
// Close distribution manager if it is not a pool
ThinClientPoolDM* pool = dynamic_cast<ThinClientPoolDM*>(m_distMngr);
- if (pool == NULL) {
+ if (pool == nullptr) {
m_distMngr->destroy();
GF_SAFE_DELETE(m_distMngr);
}
@@ -134,7 +134,7 @@ void AdminRegion::close() {
AdminRegion::~AdminRegion() {
// destructor should be single threaded in any case, so no need of guard
- if (m_distMngr != NULL) {
+ if (m_distMngr != nullptr) {
close();
}
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/AdminRegion.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/AdminRegion.hpp b/src/cppcache/src/AdminRegion.hpp
index 84f24f6..1b0196a 100644
--- a/src/cppcache/src/AdminRegion.hpp
+++ b/src/cppcache/src/AdminRegion.hpp
@@ -53,8 +53,7 @@ class CacheImpl;
*
* FIX : Make the class noncopyabl3
*/
-class AdminRegion : public SharedBase,
- private NonCopyable,
+class AdminRegion : private NonCopyable,
private NonAssignable,
public std::enable_shared_from_this<AdminRegion> {
private:
@@ -72,16 +71,15 @@ class AdminRegion : public SharedBase,
: m_distMngr(nullptr),
m_fullPath("/__ADMIN_CLIENT_HEALTH_MONITORING__"),
m_connectionMgr(nullptr),
- m_destroyPending(false)
- {}
+ m_destroyPending(false) {}
~AdminRegion();
FRIEND_STD_SHARED_PTR(AdminRegion)
public:
- static std::shared_ptr<AdminRegion> create(CacheImpl* cache,
- ThinClientBaseDM* distMan = NULL);
+ static std::shared_ptr<AdminRegion> create(
+ CacheImpl* cache, ThinClientBaseDM* distMan = nullptr);
ACE_RW_Thread_Mutex& getRWLock();
const bool& isDestroyed();
void close();
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/Assert.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/Assert.cpp b/src/cppcache/src/Assert.cpp
index 7cdc308..9dc0d5c 100644
--- a/src/cppcache/src/Assert.cpp
+++ b/src/cppcache/src/Assert.cpp
@@ -26,7 +26,7 @@ void Assert::throwAssertion(const char* expressionText, const char* file,
int line) {
LOGERROR("AssertionException: ( %s ) at %s:%d", expressionText, file, line);
- AssertionException ae(expressionText, NULL, true);
+ AssertionException ae(expressionText, nullptr, true);
ae.printStackTrace();
throw ae;
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/AttributesFactory.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/AttributesFactory.cpp b/src/cppcache/src/AttributesFactory.cpp
index ddfb220..f562522 100644
--- a/src/cppcache/src/AttributesFactory.cpp
+++ b/src/cppcache/src/AttributesFactory.cpp
@@ -115,7 +115,7 @@ void AttributesFactory::setStatisticsEnabled( bool statisticsEnabled)
std::unique_ptr<RegionAttributes> AttributesFactory::createRegionAttributes() {
RegionAttributesPtr res;
/*
- if( m_regionAttributes.m_poolName != NULL )
+ if( m_regionAttributes.m_poolName != nullptr )
{
PoolPtr pool= PoolManager::find( m_regionAttributes.m_poolName );
if (pool == nullptr) {
@@ -159,8 +159,8 @@ void AttributesFactory::validateAttributes(RegionAttributes& attrs) {
if (attrs.m_diskPolicy != DiskPolicyType::NONE) {
if (attrs.m_persistenceManager == nullptr &&
- (attrs.m_persistenceLibrary == NULL ||
- attrs.m_persistenceFactory == NULL)) {
+ (attrs.m_persistenceLibrary == nullptr ||
+ attrs.m_persistenceFactory == nullptr)) {
throw IllegalStateException(
"Persistence Manager must be set if DiskPolicy is OVERFLOWS");
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/BucketServerLocation.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/BucketServerLocation.hpp b/src/cppcache/src/BucketServerLocation.hpp
index b5afea1..78398ab 100644
--- a/src/cppcache/src/BucketServerLocation.hpp
+++ b/src/cppcache/src/BucketServerLocation.hpp
@@ -69,7 +69,7 @@ class BucketServerLocation : public ServerLocation {
m_isPrimary(isPrimary),
m_version(version) {
int32_t size = static_cast<int32_t>(serverGroups.size());
- CacheableStringPtr* ptrArr = NULL;
+ CacheableStringPtr* ptrArr = nullptr;
if (size > 0) {
ptrArr = new CacheableStringPtr[size];
for (int i = 0; i < size; i++) {
@@ -115,7 +115,7 @@ class BucketServerLocation : public ServerLocation {
input.readBoolean(&m_isPrimary);
input.read(&m_version);
input.read((&m_numServerGroups));
- CacheableStringPtr* serverGroups = NULL;
+ CacheableStringPtr* serverGroups = nullptr;
if (m_numServerGroups > 0) {
serverGroups = new CacheableStringPtr[m_numServerGroups];
for (int i = 0; i < m_numServerGroups; i++) {
@@ -177,4 +177,18 @@ class BucketServerLocation : public ServerLocation {
} // namespace geode
} // namespace apache
+namespace std {
+
+template <>
+struct hash<apache::geode::client::BucketServerLocation> {
+ typedef apache::geode::client::BucketServerLocation argument_type;
+ typedef size_t result_type;
+ size_t operator()(
+ const apache::geode::client::BucketServerLocation& val) const {
+ return val.hashcode();
+ }
+};
+
+} // namespace std
+
#endif // GEODE_BUCKETSERVERLOCATION_H_
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/Cache.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/Cache.cpp b/src/cppcache/src/Cache.cpp
index d7226ab..5d7f574 100644
--- a/src/cppcache/src/Cache.cpp
+++ b/src/cppcache/src/Cache.cpp
@@ -159,26 +159,26 @@ Cache::Cache() = default;
Cache::~Cache() = default;
/** Initialize the cache by the contents of an xml file
- * @param cacheXml
- * The xml file
- * @throws OutOfMemoryException
- * @throws CacheXmlException
- * Something went wrong while parsing the XML
- * @throws IllegalStateException
- * If xml file is well-flrmed but not valid
- * @throws RegionExistsException if a region is already in
- * this cache
- * @throws CacheClosedException if the cache is closed
- * at the time of region creation
- * @throws UnknownException otherwise
- */
+ * @param cacheXml
+ * The xml file
+ * @throws OutOfMemoryException
+ * @throws CacheXmlException
+ * Something went wrong while parsing the XML
+ * @throws IllegalStateException
+ * If xml file is well-flrmed but not valid
+ * @throws RegionExistsException if a region is already in
+ * this cache
+ * @throws CacheClosedException if the cache is closed
+ * at the time of region creation
+ * @throws UnknownException otherwise
+ */
void Cache::initializeDeclarativeCache(const char* cacheXml) {
CacheXmlParser* xmlParser = CacheXmlParser::parse(cacheXml);
xmlParser->setAttributes(this);
m_cacheImpl->initServices();
xmlParser->create(this);
delete xmlParser;
- xmlParser = NULL;
+ xmlParser = nullptr;
}
void Cache::readyForEvents() { m_cacheImpl->readyForEvents(); }
@@ -186,7 +186,7 @@ void Cache::readyForEvents() { m_cacheImpl->readyForEvents(); }
bool Cache::isPoolInMultiuserMode(RegionPtr regionPtr) {
const char* poolName = regionPtr->getAttributes()->getPoolName();
- if (poolName != NULL) {
+ if (poolName != nullptr) {
PoolPtr poolPtr = PoolManager::find(poolName);
if (poolPtr != nullptr && !poolPtr->isDestroyed()) {
return poolPtr->getMultiuserAuthentication();
@@ -209,7 +209,7 @@ PdxInstanceFactoryPtr Cache::createPdxInstanceFactory(const char* className) {
RegionServicePtr Cache::createAuthenticatedView(
PropertiesPtr userSecurityProperties, const char* poolName) {
- if (poolName == NULL) {
+ if (poolName == nullptr) {
if (!this->isClosed() && m_cacheImpl->getDefaultPool() != nullptr) {
return m_cacheImpl->getDefaultPool()->createSecureUserCache(
userSecurityProperties);
@@ -220,7 +220,7 @@ RegionServicePtr Cache::createAuthenticatedView(
"Pass poolname to get the secure Cache");
} else {
if (!this->isClosed()) {
- if (poolName != NULL) {
+ if (poolName != nullptr) {
PoolPtr poolPtr = PoolManager::find(poolName);
if (poolPtr != nullptr && !poolPtr->isDestroyed()) {
return poolPtr->createSecureUserCache(userSecurityProperties);
@@ -228,7 +228,7 @@ RegionServicePtr Cache::createAuthenticatedView(
throw IllegalStateException(
"Either pool not found or it has been destroyed");
}
- throw IllegalArgumentException("poolname is NULL");
+ throw IllegalArgumentException("poolname is nullptr");
}
throw IllegalStateException("Cache has been closed");
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/CacheAttributes.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/CacheAttributes.cpp b/src/cppcache/src/CacheAttributes.cpp
index 0eb24c0..f09adc4 100644
--- a/src/cppcache/src/CacheAttributes.cpp
+++ b/src/cppcache/src/CacheAttributes.cpp
@@ -23,7 +23,7 @@
using namespace apache::geode::client;
CacheAttributes::CacheAttributes()
- : m_redundancyLevel(0), m_endpoints(NULL), m_cacheMode(false) {}
+ : m_redundancyLevel(0), m_endpoints(nullptr), m_cacheMode(false) {}
CacheAttributes::CacheAttributes(const CacheAttributes& rhs)
: m_redundancyLevel(rhs.m_redundancyLevel) {
@@ -47,11 +47,11 @@ bool CacheAttributes::operator==(const CacheAttributes& other) const {
int32_t CacheAttributes::compareStringAttribute(char* attributeA,
char* attributeB) const {
- if (attributeA == NULL && attributeB == NULL) {
+ if (attributeA == nullptr && attributeB == nullptr) {
return 0;
- } else if (attributeA == NULL && attributeB != NULL) {
+ } else if (attributeA == nullptr && attributeB != nullptr) {
return -1;
- } else if (attributeA != NULL && attributeB == NULL) {
+ } else if (attributeA != nullptr && attributeB == nullptr) {
return -1;
}
return (strcmp(attributeA, attributeB));
@@ -63,11 +63,11 @@ bool CacheAttributes::operator!=(const CacheAttributes& other) const {
}
void CacheAttributes::copyStringAttribute(char*& lhs, const char* rhs) {
- if (lhs != NULL) {
+ if (lhs != nullptr) {
delete[] lhs;
}
- if (rhs == NULL) {
- lhs = NULL;
+ if (rhs == nullptr) {
+ lhs = nullptr;
} else {
size_t len = strlen(rhs) + 1;
lhs = new char[len];
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/CacheConfig.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/CacheConfig.cpp b/src/cppcache/src/CacheConfig.cpp
index 35de702..e8e5d0b 100644
--- a/src/cppcache/src/CacheConfig.cpp
+++ b/src/cppcache/src/CacheConfig.cpp
@@ -37,16 +37,16 @@ namespace client {
//////////////////////////////////////////////////////////////////////
CacheConfig::CacheConfig(const char* xmlFileName)
- : m_doc(NULL),
- m_root_element(NULL)
+ : m_doc(nullptr),
+ m_root_element(nullptr)
{
m_doc = xmlParseFile(xmlFileName);
- if (m_doc == NULL) {
+ if (m_doc == nullptr) {
throw IllegalArgumentException("Cacheconfig : xmlParseFile");
}
m_root_element = xmlDocGetRootElement(m_doc);
- if (m_root_element == NULL) {
+ if (m_root_element == nullptr) {
throw IllegalArgumentException("Cacheconfig : xmlDocGetRootElement");
}
if (!parse()) throw IllegalArgumentException("Cacheconfig : parse error");
@@ -61,7 +61,7 @@ CacheConfig::~CacheConfig() {
bool CacheConfig::parse() {
if (strcmp(reinterpret_cast<const char*>(m_root_element->name), "cache") ==
0) {
- xmlNode* cur_node = NULL;
+ xmlNode* cur_node = nullptr;
for (cur_node = m_root_element->children; cur_node;
cur_node = cur_node->next) {
@@ -82,8 +82,8 @@ bool CacheConfig::parseRegion(xmlNode* node) {
xmlChar* name =
xmlGetNoNsProp(node, reinterpret_cast<const unsigned char*>("name"));
- if (name != NULL) {
- xmlNode* cur_node = NULL;
+ if (name != nullptr) {
+ xmlNode* cur_node = nullptr;
for (cur_node = node->children; cur_node; cur_node = cur_node->next) {
if (cur_node->type == XML_ELEMENT_NODE) {
@@ -111,16 +111,18 @@ bool CacheConfig::parseAttributes(const char* name, xmlNode* node) {
node, reinterpret_cast<const unsigned char*>("caching-enabled"));
std::string scopeStr =
- (scope == NULL ? "invalid" : reinterpret_cast<const char*>(scope));
+ (scope == nullptr ? "invalid" : reinterpret_cast<const char*>(scope));
std::string initialCapacityStr =
- (initialCapacity == NULL ? "1000" : reinterpret_cast<const char*>(
- initialCapacity));
+ (initialCapacity == nullptr
+ ? "1000"
+ : reinterpret_cast<const char*>(initialCapacity));
std::string limitStr =
- (lruLimit == NULL ? "0" : reinterpret_cast<const char*>(lruLimit));
+ (lruLimit == nullptr ? "0" : reinterpret_cast<const char*>(lruLimit));
std::string concStr =
- (concurrency == NULL ? "0" : reinterpret_cast<const char*>(concurrency));
+ (concurrency == nullptr ? "0"
+ : reinterpret_cast<const char*>(concurrency));
std::string cachingStr =
- (caching == NULL ? "true" : reinterpret_cast<const char*>(caching));
+ (caching == nullptr ? "true" : reinterpret_cast<const char*>(caching));
auto reg = std::make_shared<RegionConfig>(scopeStr, initialCapacityStr);
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/CacheFactory.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/CacheFactory.cpp b/src/cppcache/src/CacheFactory.cpp
index 97a2adf..1ee293c 100644
--- a/src/cppcache/src/CacheFactory.cpp
+++ b/src/cppcache/src/CacheFactory.cpp
@@ -53,7 +53,7 @@ ACE_Recursive_Thread_Mutex g_cfLock;
typedef std::map<std::string, CachePtr> StringToCachePtrMap;
-void* CacheFactory::m_cacheMap = (void*)NULL;
+void* CacheFactory::m_cacheMap = (void*)nullptr;
CacheFactoryPtr* CacheFactory::default_CacheFactory = nullptr;
@@ -87,7 +87,7 @@ CacheFactoryPtr CacheFactory::createCacheFactory(
}
void CacheFactory::init() {
- if (m_cacheMap == (void*)NULL) {
+ if (m_cacheMap == (void*)nullptr) {
m_cacheMap = (void*)new StringToCachePtrMap();
}
if (!reinterpret_cast<StringToCachePtrMap*>(m_cacheMap)) {
@@ -109,8 +109,8 @@ void CacheFactory::create_(const char* name, DistributedSystemPtr& system,
throw IllegalArgumentException(
"CacheFactory::create: system uninitialized");
}
- if (name == NULL) {
- throw IllegalArgumentException("CacheFactory::create: name is NULL");
+ if (name == nullptr) {
+ throw IllegalArgumentException("CacheFactory::create: name is nullptr");
}
if (name[0] == '\0') {
name = "NativeCache";
@@ -302,7 +302,7 @@ CachePtr CacheFactory::create(const char* name,
PoolPtr CacheFactory::determineDefaultPool(CachePtr cachePtr) {
PoolPtr pool = nullptr;
- HashMapOfPools allPools = PoolManager::getAll();
+ auto allPools = PoolManager::getAll();
size_t currPoolSize = allPools.size();
// means user has not set any pool attributes
@@ -319,7 +319,7 @@ PoolPtr CacheFactory::determineDefaultPool(CachePtr cachePtr) {
cachePtr->m_cacheImpl->setDefaultPool(pool);
return pool;
} else if (currPoolSize == 1) {
- pool = allPools.begin().second();
+ pool = allPools.begin()->second;
LOGINFO("Set default pool from existing pool.");
cachePtr->m_cacheImpl->setDefaultPool(pool);
return pool;
@@ -347,8 +347,8 @@ PoolPtr CacheFactory::determineDefaultPool(CachePtr cachePtr) {
pool = nullptr;
// return any existing pool if it matches
- for (auto iter = allPools.begin(); iter != allPools.end(); ++iter) {
- auto currPool = iter.second();
+ for (const auto& iter : allPools) {
+ auto currPool = iter.second;
if (*(currPool->m_attrs) == *(this->pf->m_attrs)) {
return currPool;
}
@@ -377,12 +377,12 @@ PoolFactoryPtr CacheFactory::getPoolFactory() {
CacheFactory::~CacheFactory() {}
void CacheFactory::cleanup() {
- if (m_cacheMap != NULL) {
+ if (m_cacheMap != nullptr) {
if ((reinterpret_cast<StringToCachePtrMap*>(m_cacheMap))->empty() == true) {
(reinterpret_cast<StringToCachePtrMap*>(m_cacheMap))->clear();
}
delete (reinterpret_cast<StringToCachePtrMap*>(m_cacheMap));
- m_cacheMap = NULL;
+ m_cacheMap = nullptr;
}
}
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/CacheImpl.cpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/CacheImpl.cpp b/src/cppcache/src/CacheImpl.cpp
index 677ccc8..084d4a1 100644
--- a/src/cppcache/src/CacheImpl.cpp
+++ b/src/cppcache/src/CacheImpl.cpp
@@ -43,8 +43,8 @@
using namespace apache::geode::client;
-ExpiryTaskManager* CacheImpl::expiryTaskManager = NULL;
-CacheImpl* CacheImpl::s_instance = NULL;
+ExpiryTaskManager* CacheImpl::expiryTaskManager = nullptr;
+CacheImpl* CacheImpl::s_instance = nullptr;
volatile bool CacheImpl::s_networkhop = false;
volatile int CacheImpl::s_blacklistBucketTimeout = 0;
ACE_Recursive_Thread_Mutex CacheImpl::s_nwHopLock;
@@ -67,8 +67,8 @@ CacheImpl::CacheImpl(Cache* c, const char* name, DistributedSystemPtr sys,
m_implementee(c),
m_cond(m_mutex),
m_attributes(nullptr),
- m_evictionControllerPtr(NULL),
- m_tcrConnectionManager(NULL),
+ m_evictionControllerPtr(nullptr),
+ m_tcrConnectionManager(nullptr),
m_remoteQueryServicePtr(nullptr),
m_destroyPending(false),
m_initDone(false),
@@ -91,7 +91,7 @@ CacheImpl::CacheImpl(Cache* c, const char* name, DistributedSystemPtr sys,
}
/*
else {
- LOGFINE("Eviction controller is NULL");
+ LOGFINE("Eviction controller is nullptr");
}
*/
@@ -114,8 +114,8 @@ CacheImpl::CacheImpl(Cache* c, const char* name, DistributedSystemPtr sys,
m_implementee(c),
m_cond(m_mutex),
m_attributes(nullptr),
- m_evictionControllerPtr(NULL),
- m_tcrConnectionManager(NULL),
+ m_evictionControllerPtr(nullptr),
+ m_tcrConnectionManager(nullptr),
m_remoteQueryServicePtr(nullptr),
m_destroyPending(false),
m_initDone(false),
@@ -137,7 +137,7 @@ CacheImpl::CacheImpl(Cache* c, const char* name, DistributedSystemPtr sys,
}
/*
else {
- LOGFINE("Eviction controller is NULL");
+ LOGFINE("Eviction controller is nullptr");
}
*/
@@ -191,18 +191,11 @@ int8_t CacheImpl::getAndResetServerGroupFlag() {
void CacheImpl::netDown() {
m_tcrConnectionManager->netDown();
- const HashMapOfPools& pools = PoolManager::getAll();
- PoolPtr currPool = nullptr;
- for (HashMapOfPools::Iterator itr = pools.begin(); itr != pools.end();
- itr++) {
- currPool = itr.second();
- try {
- ThinClientPoolHADMPtr poolHADM =
- std::dynamic_pointer_cast<ThinClientPoolHADM>(currPool);
+ for (const auto& itr : PoolManager::getAll()) {
+ auto currPool = itr.second;
+ if (auto poolHADM =
+ std::dynamic_pointer_cast<ThinClientPoolHADM>(currPool)) {
poolHADM->netDown();
- } catch (const ClassCastException&) {
- // Expect a ClassCastException for non-HA PoolDMs.
- continue;
}
}
}
@@ -212,18 +205,18 @@ void CacheImpl::revive() { m_tcrConnectionManager->revive(); }
CacheImpl::RegionKind CacheImpl::getRegionKind(
const RegionAttributesPtr& rattrs) const {
RegionKind regionKind = CPP_REGION;
- const char* endpoints = NULL;
+ const char* endpoints = nullptr;
if (m_attributes != nullptr &&
- (endpoints = m_attributes->getEndpoints()) != NULL &&
+ (endpoints = m_attributes->getEndpoints()) != nullptr &&
(m_attributes->getRedundancyLevel() > 0 ||
m_tcrConnectionManager->isDurable())) {
regionKind = THINCLIENT_HA_REGION;
- } else if (endpoints != NULL && rattrs->getEndpoints() == NULL) {
+ } else if (endpoints != nullptr && rattrs->getEndpoints() == nullptr) {
rattrs->setEndpoints(endpoints);
}
- if ((endpoints = rattrs->getEndpoints()) != NULL) {
+ if ((endpoints = rattrs->getEndpoints()) != nullptr) {
if (strcmp(endpoints, "none") == 0) {
regionKind = CPP_REGION;
} else if (regionKind != THINCLIENT_HA_REGION) {
@@ -273,8 +266,8 @@ QueryServicePtr CacheImpl::getQueryService(bool noInit) {
}
QueryServicePtr CacheImpl::getQueryService(const char* poolName) {
- if (poolName == NULL || strlen(poolName) == 0) {
- throw IllegalArgumentException("PoolName is NULL or not defined..");
+ if (poolName == nullptr || strlen(poolName) == 0) {
+ throw IllegalArgumentException("PoolName is nullptr or not defined..");
}
PoolPtr pool = PoolManager::find(poolName);
@@ -293,11 +286,11 @@ CacheImpl::~CacheImpl() {
close();
}
- if (m_regions != NULL) {
+ if (m_regions != nullptr) {
delete m_regions;
}
- if (m_name != NULL) {
+ if (m_name != nullptr) {
delete[] m_name;
}
}
@@ -325,12 +318,9 @@ void CacheImpl::getDistributedSystem(DistributedSystemPtr& dptr) const {
}
void CacheImpl::sendNotificationCloseMsgs() {
- HashMapOfPools pools = PoolManager::getAll();
- for (HashMapOfPools::Iterator iter = pools.begin(); iter != pools.end();
- ++iter) {
- ThinClientPoolHADM* pool =
- dynamic_cast<ThinClientPoolHADM*>(iter.second().get());
- if (pool != NULL) {
+ for (const auto& iter : PoolManager::getAll()) {
+ if (const auto& pool =
+ std::dynamic_pointer_cast<ThinClientPoolHADM>(iter.second)) {
pool->sendNotificationCloseMsgs();
}
}
@@ -367,7 +357,7 @@ void CacheImpl::close(bool keepalive) {
// because expiryTaskManager is closed in DS::disconnect. If this happens
// then the handler will work on an already destroyed object which would
// lead to a SEGV. So cancelling the task in TcrConnectionManager::close().
- if (m_tcrConnectionManager != NULL) {
+ if (m_tcrConnectionManager != nullptr) {
m_tcrConnectionManager->close();
}
@@ -380,14 +370,14 @@ void CacheImpl::close(bool keepalive) {
// map
RegionInternalPtr rImpl =
std::dynamic_pointer_cast<RegionInternal>((*q).int_id_);
- if (rImpl != NULL) {
+ if (rImpl != nullptr) {
rImpl->destroyRegionNoThrow(
nullptr, false,
CacheEventFlags::LOCAL | CacheEventFlags::CACHE_CLOSE);
}
}
- if (m_evictionControllerPtr != NULL) {
+ if (m_evictionControllerPtr != nullptr) {
m_evictionControllerPtr->stop();
GF_SAFE_DELETE(m_evictionControllerPtr);
}
@@ -438,7 +428,7 @@ void CacheImpl::validateRegionAttributes(
}
}
-// We'll pass a NULL loader function pointer and let the region.get method to
+// We'll pass a nullptr loader function pointer and let the region.get method to
// do a load using a real C++ loader, instead of passing a member function
// pointer here
void CacheImpl::createRegion(const char* name,
@@ -492,8 +482,8 @@ void CacheImpl::createRegion(const char* name,
auto csptr = std::make_shared<CacheStatistics>();
try {
- rpImpl = createRegion_internal(namestr.c_str(), NULL, aRegionAttributes,
- csptr, false);
+ rpImpl = createRegion_internal(namestr.c_str(), nullptr,
+ aRegionAttributes, csptr, false);
} catch (const AuthenticationFailedException&) {
throw;
} catch (const AuthenticationRequiredException&) {
@@ -548,14 +538,14 @@ void CacheImpl::createRegion(const char* name,
SystemProperties* props = DistributedSystem::getSystemProperties();
if (!props->isGridClient()) {
const char* poolName = aRegionAttributes->getPoolName();
- if (poolName != NULL) {
+ if (poolName != nullptr) {
PoolPtr pool = PoolManager::find(poolName);
if (pool != nullptr && !pool->isDestroyed() &&
pool->getPRSingleHopEnabled()) {
ThinClientPoolDM* poolDM =
dynamic_cast<ThinClientPoolDM*>(pool.get());
- if ((poolDM != NULL) &&
- (poolDM->getClientMetaDataService() != NULL)) {
+ if ((poolDM != nullptr) &&
+ (poolDM->getClientMetaDataService() != nullptr)) {
LOGFINE(
"enqueued region %s for initial metadata refresh for "
"singlehop ",
@@ -596,12 +586,13 @@ void CacheImpl::getRegion(const char* path, RegionPtr& rptr) {
MapOfRegionGuard guard(m_regions->mutex());
std::string pathstr;
- if (path != NULL) {
+ if (path != nullptr) {
pathstr = path;
}
rptr = nullptr;
std::string slash("/");
- if ((path == (void*)NULL) || (pathstr == slash) || (pathstr.length() < 1)) {
+ if ((path == (void*)nullptr) || (pathstr == slash) ||
+ (pathstr.length() < 1)) {
LOGERROR("Cache::getRegion: path [%s] is not valid.", pathstr.c_str());
throw IllegalArgumentException("Cache::getRegion: path is null or a /");
}
@@ -644,14 +635,15 @@ std::shared_ptr<RegionInternal> CacheImpl::createRegion_internal(
const char* poolName = attrs->getPoolName();
const char* regionEndpoints = attrs->getEndpoints();
const char* cacheEndpoints =
- m_attributes == nullptr ? NULL : m_attributes->getEndpoints();
+ m_attributes == nullptr ? nullptr : m_attributes->getEndpoints();
- /*if(m_defaultPool != nullptr && (poolName == NULL || strlen(poolName) == 0))
+ /*if(m_defaultPool != nullptr && (poolName == nullptr || strlen(poolName) ==
+ 0))
{
attrs->setPoolName(m_defaultPool->getName());
}*/
- if (poolName != NULL) {
+ if (poolName != nullptr) {
PoolPtr pool = PoolManager::find(poolName);
if (pool != nullptr && !pool->isDestroyed()) {
bool isMultiUserSecureMode = pool->getMultiuserAuthentication();
@@ -746,21 +738,15 @@ void CacheImpl::readyForEvents() {
return;
}
- const HashMapOfPools& pools = PoolManager::getAll();
+ const auto& pools = PoolManager::getAll();
if (pools.empty()) throw IllegalStateException("No pools found.");
- PoolPtr currPool = nullptr;
- for (HashMapOfPools::Iterator itr = pools.begin(); itr != pools.end();
- itr++) {
- currPool = itr.second();
+ for (const auto& itr : pools) {
+ const auto& currPool = itr.second;
LOGDEBUG("Sending readyForEvents( ) with pool %s", currPool->getName());
try {
- try {
- ThinClientPoolHADMPtr poolHADM =
- std::dynamic_pointer_cast<ThinClientPoolHADM>(currPool);
+ if (const auto& poolHADM =
+ std::dynamic_pointer_cast<ThinClientPoolHADM>(currPool)) {
poolHADM->readyForEvents();
- } catch (const ClassCastException&) {
- // Expect a ClassCastException for non-HA PoolDMs.
- continue;
}
} catch (Exception& ex) {
LOGWARN("readyForEvents( ) failed for pool %s with exception: %s",
@@ -770,29 +756,23 @@ void CacheImpl::readyForEvents() {
}
bool CacheImpl::getEndpointStatus(const std::string& endpoint) {
- const HashMapOfPools& pools = PoolManager::getAll();
- std::string fullName;
-
- /*
- fullName = endpoint.find(':') == std::string::npos ? endpoint :
- Utils::convertHostToCanonicalForm(endpoint.c_str() );
- */
- fullName = endpoint;
+ const auto& pools = PoolManager::getAll();
+ std::string fullName = endpoint;
if (pools.empty()) {
return m_tcrConnectionManager->getEndpointStatus(fullName);
}
+
fullName = endpoint.find(':') == std::string::npos
? endpoint
: Utils::convertHostToCanonicalForm(endpoint.c_str());
- ThinClientPoolDMPtr currPool =
- std::static_pointer_cast<GF_UNWRAP_SP(ThinClientPoolDMPtr)>(pools.begin().second());
- ACE_Guard<ACE_Recursive_Thread_Mutex> guard(currPool->m_endpointsLock);
- for (ACE_Map_Manager<std::string, TcrEndpoint*,
- ACE_Recursive_Thread_Mutex>::iterator itr =
- currPool->m_endpoints.begin();
- itr != currPool->m_endpoints.end(); itr++) {
- TcrEndpoint* ep = (*itr).int_id_;
+
+ const auto firstPool =
+ std::static_pointer_cast<ThinClientPoolDM>(pools.begin()->second);
+
+ ACE_Guard<ACE_Recursive_Thread_Mutex> guard(firstPool->m_endpointsLock);
+ for (const auto& itr : firstPool->m_endpoints) {
+ const auto& ep = itr.int_id_;
if (ep->name().find(fullName) != std::string::npos) {
return ep->getServerQueueStatusTEST();
}
@@ -808,22 +788,18 @@ void CacheImpl::processMarker() {
MapOfRegionGuard guard(m_regions->mutex());
- for (MapOfRegionWithLock::iterator q = m_regions->begin();
- q != m_regions->end(); ++q) {
- if (!(*q).int_id_->isDestroyed()) {
- ThinClientHARegion* tcrHARegion =
- dynamic_cast<ThinClientHARegion*>((*q).int_id_.get());
- if (tcrHARegion != NULL) {
- TcrMessage* regionMsg = new TcrMessageClientMarker(true);
+ for (const auto& q : *m_regions) {
+ if (!q.int_id_->isDestroyed()) {
+ if (const auto tcrHARegion =
+ std::dynamic_pointer_cast<ThinClientHARegion>(q.int_id_)) {
+ auto regionMsg = new TcrMessageClientMarker(true);
tcrHARegion->receiveNotification(regionMsg);
VectorOfRegion subregions;
tcrHARegion->subregions(true, subregions);
- for (VectorOfRegion::Iterator iter = subregions.begin();
- iter != subregions.end(); ++iter) {
- if (!(*iter)->isDestroyed()) {
- ThinClientHARegion* subregion =
- dynamic_cast<ThinClientHARegion*>((*iter).get());
- if (subregion != NULL) {
+ for (const auto& iter : subregions) {
+ if (!iter->isDestroyed()) {
+ if (const auto subregion =
+ std::dynamic_pointer_cast<ThinClientHARegion>(iter)) {
regionMsg = new TcrMessageClientMarker(true);
subregion->receiveNotification(regionMsg);
}
@@ -835,17 +811,12 @@ void CacheImpl::processMarker() {
}
int CacheImpl::getPoolSize(const char* poolName) {
- PoolPtr pool = PoolManager::find(poolName);
- if (pool == nullptr) {
- return -1;
- } else {
- ThinClientPoolDM* dm = dynamic_cast<ThinClientPoolDM*>(pool.get());
- if (dm) {
+ if (const auto pool = PoolManager::find(poolName)) {
+ if (const auto dm = std::dynamic_pointer_cast<ThinClientPoolDM>(pool)) {
return dm->m_poolSize;
- } else {
- return -1;
}
}
+ return -1;
}
RegionFactoryPtr CacheImpl::createRegionFactory(
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/CacheImpl.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/CacheImpl.hpp b/src/cppcache/src/CacheImpl.hpp
index f0dede3..03c0805 100644
--- a/src/cppcache/src/CacheImpl.hpp
+++ b/src/cppcache/src/CacheImpl.hpp
@@ -163,7 +163,7 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
* @todo change return to param for regionPtr...
* @param regionPtr the pointer object pointing to the returned region object
* when the function returns
- * @throws InvalidArgumentException if the attributePtr is NULL.
+ * @throws InvalidArgumentException if the attributePtr is nullptr.
* @throws RegionExistsException if a region is already in
* this cache
* @throws CacheClosedException if the cache is closed
@@ -209,8 +209,8 @@ class CPPCACHE_EXPORT CacheImpl : private NonCopyable, private NonAssignable {
CacheTransactionManagerPtr getCacheTransactionManager();
/**
- * @brief destructor
- */
+ * @brief destructor
+ */
virtual ~CacheImpl();
/**
* @brief constructors
http://git-wip-us.apache.org/repos/asf/geode-native/blob/11467dd9/src/cppcache/src/CachePerfStats.hpp
----------------------------------------------------------------------
diff --git a/src/cppcache/src/CachePerfStats.hpp b/src/cppcache/src/CachePerfStats.hpp
index 33b9eb9..adfda8b 100644
--- a/src/cppcache/src/CachePerfStats.hpp
+++ b/src/cppcache/src/CachePerfStats.hpp
@@ -39,7 +39,7 @@ class CPPCACHE_EXPORT CachePerfStats {
StatisticsType* statsType = factory->findType("CachePerfStats");
- if (statsType == NULL) {
+ if (statsType == nullptr) {
const bool largerIsBetter = true;
StatisticDescriptor** statDescArr = new StatisticDescriptor*[24];
@@ -140,7 +140,7 @@ class CPPCACHE_EXPORT CachePerfStats {
"Statistics about native client cache",
statDescArr, 24);
}
- GF_D_ASSERT(statsType != NULL);
+ GF_D_ASSERT(statsType != nullptr);
// Create Statistics object
m_cachePerfStats =
factory->createAtomicStatistics(statsType, "CachePerfStats");
@@ -201,7 +201,7 @@ class CPPCACHE_EXPORT CachePerfStats {
m_cachePerfStats->setLong(m_pdxDeserializedBytesId, 0);
}
- virtual ~CachePerfStats() { m_cachePerfStats = NULL; }
+ virtual ~CachePerfStats() { m_cachePerfStats = nullptr; }
void close() {
/*StatisticDescriptor** statDescArr =