mac-op commented on code in PR #25:
URL: https://github.com/apache/uima-uimacpp/pull/25#discussion_r1723843256


##########
src/framework/flow.cpp:
##########


Review Comment:
   I had my own sanity checks when I created these. Should I add them into the 
testcases?



##########
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 misunderstood your comment, but after checking with the Java version I see 
you're correct. We should be setting the owner for the base CAS instead. I am 
fixing that.



-- 
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: dev-unsubscr...@uima.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to