mac-op commented on code in PR #25:
URL: https://github.com/apache/uima-uimacpp/pull/25#discussion_r1723727157
##########
src/framework/caspool.cpp:
##########
@@ -77,6 +79,38 @@ namespace uima {
}
+ CASPool::CASPool(AnnotatorContext *anContext, const
AnalysisEngineDescription &taeSpec,
+ size_t numInstances) : iv_vecAllInstances(),
+ iv_vecFreeInstances(),
+ iv_numInstances(numInstances),
+ iv_pCasDef(nullptr),
+ iv_pOwner(anContext) {
+ iv_pCasDef = internal::CASDefinition::createCASDefinition(taeSpec);
+ if (iv_pCasDef == nullptr) {
+ UIMA_EXC_THROW_NEW(CASPoolException,
+ UIMA_ERR_CASPOOL_CREATE_CASDEFINITION,
+ UIMA_MSG_ID_EXC_CREATE_CASPOOL,
+ UIMA_MSG_ID_EXC_CREATE_CASPOOL,
+ ErrorInfo::unrecoverable);
+ }
+
+ for (size_t i = 0; i < numInstances; i++) {
+ CAS *pCas = uima::internal::CASImpl::createCASImpl(*iv_pCasDef, false);
+ if (pCas == nullptr) {
+ UIMA_EXC_THROW_NEW(CASPoolException,
+ UIMA_ERR_CASPOOL_CREATE_CAS,
+ UIMA_MSG_ID_EXC_CREATE_CASPOOL,
+ UIMA_MSG_ID_EXC_CREATE_CASPOOL,
+ ErrorInfo::unrecoverable);
+ }
+ CAS *initialView = pCas->getInitialView();
Review Comment:
I believe that's the way the framework constructs the CAS Pool. If you look
at the old constructor, it's not adding the new base CAS into the pool, but
only its initial view.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]