You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ea...@apache.org on 2007/02/03 17:58:56 UTC
svn commit: r503251 [2/13] -
/incubator/uima/uimacpp/trunk/src/framework/uima/
Added: incubator/uima/uimacpp/trunk/src/framework/uima/api.hpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/api.hpp?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/api.hpp (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/api.hpp Sat Feb 3 08:58:54 2007
@@ -0,0 +1,71 @@
+/** \file api.hpp .
+-----------------------------------------------------------------------------
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-----------------------------------------------------------------------------
+
+ Description:
+
+-------------------------------------------------------------------------- */
+
+#ifndef UIMA_API_HPP
+#define UIMA_API_HPP
+
+/* ----------------------------------------------------------------------- */
+/* Include dependencies */
+/* ----------------------------------------------------------------------- */
+
+#include "uima/pragmas.hpp"
+
+#include "uima/annotator_context.hpp"
+#include "uima/ccsid.hpp"
+#include "uima/language.hpp"
+#include "uima/log.hpp"
+#include "uima/strtools.hpp"
+#include "uima/result_specification.hpp"
+#include "uima/token_properties.hpp"
+#include "uima/timedatetools.hpp"
+#include "uima/cas.hpp"
+#include "uima/xmltypesystemreader.hpp"
+#include "uima/fsindexrepository.hpp"
+#include "uima/lowlevel_typesystem.hpp"
+#include "uima/lowlevel_fsheap.hpp"
+#include "uima/lowlevel_indexrepository.hpp"
+#include "uima/fsindex.hpp"
+#include "uima/listfs.hpp"
+#include "uima/arrayfs.hpp"
+#include "uima/unistrref.hpp"
+#include "uima/resmgr.hpp"
+#include "uima/fsindexrepository.hpp"
+#include "uima/msg.h"
+#include "uima/config_tools.hpp"
+#include "uima/comp_ids.h" /* for trace */
+#include "uima/annotator_abase.hpp"
+#include "uima/engine.hpp"
+#include "uima/taespecifierbuilder.hpp"
+#include "uima/log.hpp"
+
+
+
+
+/* ----------------------------------------------------------------------- */
+#endif /* UIMA_API_HPP */
+
+/* <EOF> */
+
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/api.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/assertmsg.h
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/assertmsg.h?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/assertmsg.h (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/assertmsg.h Sat Feb 3 08:58:54 2007
@@ -0,0 +1,151 @@
+/** \file assertmsg.h .
+-----------------------------------------------------------------------------
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-----------------------------------------------------------------------------
+
+ \brief An extension of the assert routine to print a message on failure
+
+-------------------------------------------------------------------------- */
+
+#ifndef __UIMA_ASSERTMSG_H
+#define __UIMA_ASSERTMSG_H
+
+/* ----------------------------------------------------------------------- */
+/* Interface dependencies */
+/* ----------------------------------------------------------------------- */
+
+#include <assert.h>
+
+/* ----------------------------------------------------------------------- */
+/* Implementation dependencies */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Constants */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Types / Classes */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Globals */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Function declarations */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Macro definitions */
+/* ----------------------------------------------------------------------- */
+
+/**
+ <tt> assert</tt> prints a diagnostic message to stderr and aborts the program
+ if expression is false (zero).
+
+ Use <tt> assert</tt> to identify program logic errors.
+ Choose an expression that holds true only if the program is operating as
+ you intend. After you have debugged the program, you can use the special
+ no-debug identifier NDEBUG to remove the <tt> assert</tt> calls from the program.
+ If you define NDEBUG to any value with a \#define directive, the C
+ preprocessor expands all <tt> assert</tt> invocations to void expressions.
+ If you use NDEBUG, you must define it before you include "uima/assertmsg.h" in
+ the program.
+
+ There is no return value.
+
+ Example:
+ \code
+ foo(const void * cpvP1, const void * cpvP2, int i)
+ {
+ assert(EXISTS(cpvP1));
+ assert(EXISTS(cpvP2));
+ assert((i > 0) && (i < 100));
+ ...
+ }
+ \endcode
+ \note <tt> assert</tt> is no longer implemented here ... the system macro is used.
+ Do not use the \#undef directive with <tt> assert</tt>.
+
+ \line
+
+ <tt> assertWithMsg</tt> prints a diagnostic message to stderr and aborts the
+ program if expression is false (zero).
+
+ <tt> assertWithMsg</tt> has the same purpose as <tt> assert</tt> with the
+ additional feature that you can pass an additional message string to
+ the function which gets displayed in case the specified expression
+ evaluates to false (zero).
+
+ Use <tt> assertWithMsg</tt> to identify program logic errors.
+ Choose an expression that holds true only if the program is operating as
+ you intend. After you have debugged the program, you can use the special
+ no-debug identifier NDEBUG to remove the <tt> assertWithMsg</tt> calls from the
+ program. If you define NDEBUG to any value with a \#define directive, the
+ C preprocessor expands all <tt> assertWithMsg</tt> invocations to void
+ expressions.
+ If you use NDEBUG, you must define it before you include "uima/assertmsg.h" in
+ the program.
+
+ There is no return value.
+
+ Example:
+ \code
+ foo(const void * cpvP1, const void * cpvP2, int i)
+ {
+ assert(EXISTS(cpvP1));
+ assert(EXISTS(cpvP2));
+ assertWithMsg(((i > 0) && (i < 100)), "invalid value specified");
+ ...
+ }
+ \endcode
+ \note <tt> assertWithMsg</tt> is implemented as a macro.
+ Do not use the \#undef directive with <tt> assertWithMsg</tt>.
+
+ @see assert
+*/
+
+#ifndef NDEBUG
+
+#ifdef assertWithMsg
+#undef assertWithMsg
+#endif
+
+// plugin_annotator_test would not link when used C++ I/O !
+// e.g. if (!(expr)) {cerr<<"Assert msg:"<<msg<<endl;assert(expr);}
+#define assertWithMsg(expr,msg) if (!(expr)) {fprintf(stderr,"Assert msg: %s\n",msg);assert(expr);}
+
+#else /* NDEBUG defined */
+
+#ifdef assertWithMsg
+#undef assertWithMsg
+#endif
+#define assertWithMsg( ignore, msg ) ( ( void )0 )
+
+#endif
+
+/* ----------------------------------------------------------------------- */
+/* Implementation */
+/* ----------------------------------------------------------------------- */
+
+#endif /* __UIMA_ASSERTMSG_H */
+
+/* <EOF> */
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/assertmsg.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/capability.hpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/capability.hpp?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/capability.hpp (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/capability.hpp Sat Feb 3 08:58:54 2007
@@ -0,0 +1,228 @@
+/** \file capability.hpp .
+-----------------------------------------------------------------------------
+
+
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-----------------------------------------------------------------------------
+
+ \brief Contains class uima::Capability
+
+ Description: A Capability object defines the capabilities of a TextAnalysisEngine
+
+-----------------------------------------------------------------------------
+
+
+ 01/30/2003 Initial creation
+
+-------------------------------------------------------------------------- */
+#ifndef UIMA_CAPABILITY_HPP
+#define UIMA_CAPABILITY_HPP
+
+// ---------------------------------------------------------------------------
+// Includes
+// ---------------------------------------------------------------------------
+
+#include "uima/pragmas.hpp" //must be first to surpress warnings
+#include "uima/err_ids.h"
+
+#include "uima/taemetadata.hpp"
+#include <vector>
+
+namespace uima {
+
+ /**
+ * Defines the capability of a <code>TextAnalysisEngine</code> in terms of the required input and output
+ * types and features and the supported languages. A <code>TextAnalysisEngine</code> can be described
+ * by more than one <code>Capability</code>, for example,
+ * if the input and output types/features differ, depending on
+ * the language.
+ * The Capability is expressed in terms of input and output type, feature and Sofa names.
+ **/
+ class UIMA_LINK_IMPORTSPEC Capability :public MetaDataObject {
+ public:
+ typedef vector <icu::UnicodeString > TyVecCapabilityTofs;
+ typedef vector <icu::UnicodeString > TyVecCapabilityLanguages;
+ typedef vector <icu::UnicodeString > TyVecCapabilitySofas;
+
+ enum EnTypeStyle {
+ INPUT, OUTPUT, INPUTSOFA, OUTPUTSOFA
+ };
+
+ Capability()
+ :MetaDataObject(), iv_inputFeatures(), iv_inputTypes(), iv_outputFeatures(),
+ iv_outputTypes(), iv_supportedLanguages() {}
+
+ /**
+ * @param type The name of the type to be added
+ * @param typeStyle Determines whether it's an input or output type
+ **/
+ TyErrorId addCapabilityType(const icu::UnicodeString & type, EnTypeStyle typeStyle) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+ switch (typeStyle) {
+ case INPUT:
+ iv_inputTypes.push_back(type);
+ break;
+ case OUTPUT:
+ iv_outputTypes.push_back(type);
+ break;
+ default:
+ //TBD: error handling
+ cerr << "Wrong output type " << typeStyle << endl;
+ break;
+ }
+
+ return UIMA_ERR_NONE;
+ }
+
+ /**
+ * @param feature The name of the feature to be added
+ * @param typeStyle Determines whether it's an input or output feature
+ **/
+ TyErrorId addCapabilityFeature(const icu::UnicodeString & feature, EnTypeStyle typeStyle) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+ switch (typeStyle) {
+ case INPUT:
+ iv_inputFeatures.push_back(feature);
+ break;
+ case OUTPUT:
+ iv_outputFeatures.push_back(feature);
+ break;
+ default:
+ //TBD: error handling
+ assert(false);
+ break;
+ }
+ return UIMA_ERR_NONE;
+ }
+
+
+
+ /**
+ * Set the input or output Sofa name
+ * @param sofa The name of the sofa to be added
+ * @param typeStyle Determines whether it's an input or output sofa
+ **/
+ TyErrorId addCapabilitySofa(const icu::UnicodeString & sofa, EnTypeStyle typeStyle) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+ switch (typeStyle) {
+ case INPUTSOFA:
+ iv_inputSofas.push_back(sofa);
+ break;
+ case OUTPUTSOFA:
+ iv_outputSofas.push_back(sofa);
+ break;
+ default:
+ //TBD: error handling
+ assert(false);
+ break;
+ }
+ return UIMA_ERR_NONE;
+ }
+
+
+ /**
+ * Get input/output Types
+ */
+ const TyVecCapabilityTofs & getCapabilityTypes(EnTypeStyle typeStyle) const {
+ switch (typeStyle) {
+ case INPUT:
+ return iv_inputTypes;
+ break;
+ case OUTPUT:
+ return iv_outputTypes;
+ break;
+ default:
+ assert(false);
+ return iv_inputTypes;
+ }
+ }
+
+
+ /**
+ * Get the input/output features
+ */
+ const TyVecCapabilityTofs & getCapabilityFeatures(EnTypeStyle typeStyle) const {
+ switch (typeStyle) {
+ case INPUT:
+ return iv_inputFeatures;
+ break;
+ case OUTPUT:
+ return iv_outputFeatures;
+ break;
+ default:
+ assert(false);
+ return iv_inputFeatures;
+ }
+ }
+
+ /**
+ * Get the input/output Sofas
+ */
+ const TyVecCapabilitySofas & getCapabilitySofas(EnTypeStyle typeStyle) const {
+ switch (typeStyle) {
+ case INPUTSOFA:
+ return iv_inputSofas;
+ break;
+ case OUTPUTSOFA:
+ return iv_outputSofas;
+ break;
+ default:
+ assert(false);
+ return iv_inputSofas;
+ }
+ }
+
+
+
+ TyErrorId addSupportedLanguage(const icu::UnicodeString & language) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+ iv_supportedLanguages.push_back(language);
+ return UIMA_ERR_NONE;
+ }
+
+ const TyVecCapabilityLanguages & getSupportedLanguages() const {
+ return iv_supportedLanguages;
+ }
+
+
+ private:
+ /* Capability(const Capability & crOther); */
+ Capability & operator=(const Capability & crOther);
+
+ TyVecCapabilityTofs iv_inputFeatures;
+ TyVecCapabilityTofs iv_inputTypes;
+ TyVecCapabilityTofs iv_outputFeatures;
+ TyVecCapabilityTofs iv_outputTypes;
+ TyVecCapabilityLanguages iv_supportedLanguages;
+ TyVecCapabilitySofas iv_inputSofas;
+ TyVecCapabilitySofas iv_outputSofas;
+
+ };
+}
+
+#endif
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/capability.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/casdefinition.hpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/casdefinition.hpp?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/casdefinition.hpp (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/casdefinition.hpp Sat Feb 3 08:58:54 2007
@@ -0,0 +1,196 @@
+#ifndef UIMA_CASDEFINITION_HPP
+#define UIMA_CASDEFINITION_HPP
+
+/** \file casdefinition.hpp .
+-----------------------------------------------------------------------------
+
+
+
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-----------------------------------------------------------------------------
+
+ \brief Class holding type system and index definitions
+
+ Description:
+
+-----------------------------------------------------------------------------
+
+
+-------------------------------------------------------------------------- */
+
+
+/* ----------------------------------------------------------------------- */
+/* Include dependencies */
+/* ----------------------------------------------------------------------- */
+#include "uima/pragmas.hpp"
+
+#include "uima/err_ids.h"
+#include "uima/taespecifier.hpp"
+/* ----------------------------------------------------------------------- */
+/* Constants */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Forward declarations */
+/* ----------------------------------------------------------------------- */
+namespace uima {
+ class AnalysisEngineDescription;
+ class AnnotatorContext;
+ class AnalysisEngineMetaData;
+ class TypeSystem;
+ class TypeSystemDescription;
+ class TyVecpFSIndexDescriptions;
+ class TyVecpTypePriorities;
+
+ namespace lowlevel {
+ class IndexDefinition;
+ class TypeSystem;
+ }
+}
+
+
+
+/* ----------------------------------------------------------------------- */
+/* Types / Classes */
+/* ----------------------------------------------------------------------- */
+
+namespace uima {
+ namespace internal {
+ /**
+ * This class contains all information about CASs which live longer than a document,
+ * in particular the type system and the index definition.
+ * An AnalysisEngine holds a reference to a CASDefinition object which is
+ * used when newCAS() is called.
+ */
+ class UIMA_LINK_IMPORTSPEC CASDefinition {
+ protected:
+ uima::lowlevel::TypeSystem * iv_typeSystem;
+ uima::lowlevel::IndexDefinition * iv_indexDefinition;
+
+ AnnotatorContext const * iv_annotatorContext;
+
+ void mergeTypeSystem(AnalysisEngineDescription const &);
+ void createIndexesFromANC(AnnotatorContext const &);
+ void addTypePriorities(AnalysisEngineDescription const &);
+
+ virtual void createTypes();
+ virtual void createIndexes();
+
+ void createPredefinedCASTypes();
+ void createPredefinedCASIndexes();
+
+ void commitTypeSystem();
+ void commitIndexDefinition();
+
+ bool bOwnsTypeSystem;
+ void createIndexesFromSpecifier(AnalysisEngineMetaData::TyVecpFSIndexDescriptions const & ) ;
+ void addTypePriorities(AnalysisEngineMetaData::TyVecpTypePriorities const & );
+ void mergeTypeSystem(TypeSystemDescription const &,
+ icu::UnicodeString const & );
+ void commitTypeSystemOnly();
+
+
+ CASDefinition(AnnotatorContext const * );
+ CASDefinition(AnalysisEngineDescription const &);
+ CASDefinition(uima::TypeSystem &);
+ CASDefinition();
+
+ public:
+ static CASDefinition * createCASDefinition(AnnotatorContext const &);
+ /**
+ * Construct a CASDefinition from the TextAnalysisSpecifier
+ */
+ static CASDefinition * createCASDefinition(AnalysisEngineDescription const &);
+ /**
+ * Construct a CASDefinition from AnalysisEngineMetaData
+ */
+ static CASDefinition * createCASDefinition(AnalysisEngineMetaData const &);
+ /**
+ * Construct a CASDefinition with specified TypeSystem and built in indices.
+ */
+ static CASDefinition * createCASDefinition(uima::TypeSystem &);
+ /**
+ * Construct a CASDefinition from the TypeSystem with indices define in the AnalysisEngineMetaData
+ */
+ static CASDefinition * createCASDefinition(uima::TypeSystem &,
+ AnalysisEngineMetaData const &);
+
+ /**
+ * Construct a CASDefinition from the TypeSystem, index and type priority descriptions
+ */
+ static CASDefinition * createCASDefinition(TypeSystem &,
+ AnalysisEngineMetaData::TyVecpFSIndexDescriptions const &,
+ AnalysisEngineMetaData::TyVecpTypePriorities const &);
+
+ /**
+ * Construct a CASDefinition from the TypeSystem, index and type priority descriptions
+ */
+ static CASDefinition * createCASDefinition(TypeSystem &,
+ AnalysisEngineMetaData::TyVecpFSIndexDescriptions const &);
+
+
+ /**
+ * Construct a TypeSystem object from the type system definition and type priorities
+ * defined in the AnalysisEngineMetaData object
+ * Returns a committed typesystem
+ */
+ static uima::lowlevel::TypeSystem * createTypeSystem(AnalysisEngineMetaData const &);
+ /**
+ * Construct a TypeSystem from the TypeSystemDescription
+ * Return a committed TypeSystem object
+ */
+ static uima::lowlevel::TypeSystem * createTypeSystem(TypeSystemDescription const &,
+ icu::UnicodeString const & );
+ /**
+ * Construct a TypeSystem object given the typesystem description and type priorities.
+ * Returns a committed TypeSystem object.
+ */
+ static uima::lowlevel::TypeSystem * createTypeSystem(TypeSystemDescription const &,
+ AnalysisEngineMetaData::TyVecpTypePriorities const &,
+ icu::UnicodeString const & );
+
+
+
+ virtual ~CASDefinition();
+
+ void init();
+ void commit();
+
+ uima::lowlevel::TypeSystem & getTypeSystem();
+ uima::lowlevel::TypeSystem const & getTypeSystem() const;
+
+ uima::lowlevel::IndexDefinition & getIndexDefinition();
+ uima::lowlevel::IndexDefinition const & getIndexDefinition() const;
+ };
+
+
+ }
+}
+
+/* ----------------------------------------------------------------------- */
+/* Implementation */
+/* ----------------------------------------------------------------------- */
+
+
+/* ----------------------------------------------------------------------- */
+
+
+#endif
+
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/casdefinition.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/casiterator.hpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/casiterator.hpp?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/casiterator.hpp (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/casiterator.hpp Sat Feb 3 08:58:54 2007
@@ -0,0 +1,112 @@
+/** \file sofastream.hpp .
+-----------------------------------------------------------------------------
+
+
+
+ \brief Contains class uima::CASIterator
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-------------------------------------------------------------------------- */
+#ifndef UIMA_CASITERATOR_HPP
+#define UIMA_CASITERATOR_HPP
+
+// ---------------------------------------------------------------------------
+// Includes
+// ---------------------------------------------------------------------------
+
+#include "uima/pragmas.hpp" //must be first to surpress warnings
+#include "uima/err_ids.h"
+#include "uima/engine.hpp"
+#include "uima/cas.hpp"
+
+#include <vector>
+
+/* ----------------------------------------------------------------------- */
+/* Forward declarations */
+/* ----------------------------------------------------------------------- */
+namespace uima {
+ class AnalysisEngine;
+ class TextAnalysisEngine;
+ namespace internal {
+ class EngineBase;
+ }
+}
+
+
+/* ----------------------------------------------------------------------- */
+/* Types / Classes */
+/* ----------------------------------------------------------------------- */
+namespace uima {
+
+ /**------------------------------------------------
+ * CASPool
+ * This class manages pool of CAS objects
+ *------------------------------------------------
+ */
+
+ UIMA_EXC_CLASSDECLARE(CASIteratorException, uima::Exception);
+
+ class UIMA_LINK_IMPORTSPEC CASIterator {
+ friend class uima::AnalysisEngine;
+ friend class uima::TextAnalysisEngine;
+ friend class uima::internal::EngineBase;
+ private:
+ AnalysisEngine * iv_engine;
+
+ protected:
+
+
+
+
+ /** Constructor
+ * Creates the specified number of CAS instances based on CAS definition
+ * as specified in the TAE specifier.
+ */
+ CASIterator(AnalysisEngine * pEngine);
+ public:
+ /** Destructor */
+ ~CASIterator(void);
+
+
+ /**
+ * Checks if there are more CASes to be returned by the iterator.
+ *
+ * @return true if there are more CASes to be returned, false if not
+ *
+ */
+ bool hasNext(void);
+
+
+ /**
+ * Gets the next CAS from the iterator.
+ * @returns a pointer to a CAS.
+ */
+ CAS & next(void);
+
+
+ /**
+ * Releases any CASes owned by this CasIterator. You only need to call this method
+ * if you stop using a CasIterator before you have iterated all the way through.
+ */
+ void release(void);
+ };
+
+}
+
+#endif
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/casiterator.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/caspool.hpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/caspool.hpp?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/caspool.hpp (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/caspool.hpp Sat Feb 3 08:58:54 2007
@@ -0,0 +1,101 @@
+/** \file sofastream.hpp .
+-----------------------------------------------------------------------------
+
+
+
+ \brief Contains class uima::CASPool
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-------------------------------------------------------------------------- */
+#ifndef UIMA_CASPOOL_HPP
+#define UIMA_CASPOOL_HPP
+
+// ---------------------------------------------------------------------------
+// Includes
+// ---------------------------------------------------------------------------
+
+#include "uima/pragmas.hpp" //must be first to surpress warnings
+#include "uima/err_ids.h"
+#include "uima/taespecifier.hpp"
+#include "uima/cas.hpp"
+#include "uima/internal_casimpl.hpp"
+#include "uima/casdefinition.hpp"
+
+#include <vector>
+
+/* ----------------------------------------------------------------------- */
+/* Forward declarations */
+/* ----------------------------------------------------------------------- */
+namespace uima {
+ class AnalysisEngineDescription;
+ class internal::CASDefinition;
+}
+
+
+/* ----------------------------------------------------------------------- */
+/* Types / Classes */
+/* ----------------------------------------------------------------------- */
+namespace uima {
+
+ /**------------------------------------------------
+ * CASPool
+ * This class manages pool of CAS objects
+ *------------------------------------------------
+ */
+
+ UIMA_EXC_CLASSDECLARE(CASPoolException, uima::Exception);
+
+ class UIMA_LINK_IMPORTSPEC CASPool {
+ private:
+ vector<CAS *> iv_vecAllInstances;
+ vector<CAS *> iv_vecFreeInstances;
+ size_t iv_numInstances;
+ uima::internal::CASDefinition * iv_pCasDef;
+
+ public:
+
+ /** Constructor
+ * Creates the specified number of CAS instances based on CAS definition
+ * as specified in the TAE specifier.
+ */
+ CASPool(const AnalysisEngineDescription & taeSpec, size_t numInstances);
+
+ /** Destructor */
+ ~CASPool(void);
+
+ /**
+ * Check out a free CAS intance.
+ * @returns a pointer to a CAS or null if there are no free CASs available.
+ */
+ CAS & getCAS(void);
+
+
+ /**
+ * Checks in a CAS to the pool. This automatically calls the
+ * {@link CAS#reset()} method, to ensure that when the CAS is later
+ * retrieved from the pool it will be ready to use.
+ *
+ * @param aCas the Cas to release
+ */
+ void releaseCAS(CAS & );
+ };
+
+}
+
+#endif
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/caspool.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/caswriter_abase.hpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/caswriter_abase.hpp?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/caswriter_abase.hpp (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/caswriter_abase.hpp Sat Feb 3 08:58:54 2007
@@ -0,0 +1,90 @@
+#ifndef UIMA_CASWRITER_ABASE_HPP
+#define UIMA_CASWRITER_ABASE_HPP
+/** \file caswriter_abase.hpp .
+-----------------------------------------------------------------------------
+
+
+
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-----------------------------------------------------------------------------
+
+ \brief An abstract base class for CAS writers
+
+ Description:
+
+-----------------------------------------------------------------------------
+
+
+-------------------------------------------------------------------------- */
+
+
+/* ----------------------------------------------------------------------- */
+/* Include dependencies */
+/* ----------------------------------------------------------------------- */
+#include "uima/pragmas.hpp"
+
+#include <iostream>
+#include "uima/types.h"
+
+/* ----------------------------------------------------------------------- */
+/* Constants */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Forward declarations */
+/* ----------------------------------------------------------------------- */
+
+namespace uima {
+ class CAS;
+}
+
+/* ----------------------------------------------------------------------- */
+/* Types / Classes */
+/* ----------------------------------------------------------------------- */
+
+namespace uima {
+ /**
+ * This is an abstract base class for CAS writers, i.e., a class which
+ * can write a CAS to an ostrema. Examples are
+ * XCAS writers and XML dump writers (dump annotator).
+ */
+ class UIMA_LINK_IMPORTSPEC CASWriterABase {
+ protected:
+ CAS const & iv_cas;
+ bool iv_addDocument;
+ public:
+ CASWriterABase(CAS const & crCAS, bool bAddDocument);
+ virtual ~CASWriterABase();
+
+ virtual void write(ostream& os) = 0;
+ };
+
+}
+
+
+/* ----------------------------------------------------------------------- */
+/* Implementation */
+/* ----------------------------------------------------------------------- */
+
+
+/* ----------------------------------------------------------------------- */
+
+
+#endif
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/caswriter_abase.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/ccsid.hpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/ccsid.hpp?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/ccsid.hpp (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/ccsid.hpp Sat Feb 3 08:58:54 2007
@@ -0,0 +1,125 @@
+/** \file ccsid.hpp .
+-----------------------------------------------------------------------------
+
+
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-----------------------------------------------------------------------------
+
+ \brief Contains CCSID a class to represent a CCSID (Coded Character Set Identifiers)
+
+ Description:
+
+-----------------------------------------------------------------------------
+
+
+ 5/21/1999 Initial creation
+
+-------------------------------------------------------------------------- */
+
+#ifndef UIMA_CCSID_HPP
+#define UIMA_CCSID_HPP
+
+/* ----------------------------------------------------------------------- */
+/* Include dependencies */
+/* ----------------------------------------------------------------------- */
+
+#include "uima/pragmas.hpp"
+#include "uima/text.h"
+#include "unicode/ucnv.h"
+
+/* ----------------------------------------------------------------------- */
+/* Constants */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Forward declarations */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Types / Classes */
+/* ----------------------------------------------------------------------- */
+
+namespace uima {
+ /**
+ * The class <TT>CCSID</TT> used to represent a CCSID,
+ * now a char* encoding string
+ * @see
+ */
+ class CCSID {
+
+ public:
+ /// replaces CCSID::getSystemCCSID() - call ICU ucnv_getDefaultName()
+ /// which is described as:
+ /// Get the default converter name that is currently used by ICU and the operating system.
+ /// TODO: this also replaces CCSid::getConsoleCCSID() is this the
+ /// right thing to do ?
+ static char const * getDefaultName();
+
+ /// return a string version of the default single byte input ccsid
+ static char const * getDefaultSBCSInputCCSID( void );
+
+ /// return a string version of the default single byte output ccsid
+ static char const * getDefaultSBCSOutputCCSID( void );
+
+ // Hide all constructors !? Replace the class with "const char* encoding"
+ private:
+ /** @name Constructors */
+ /*@{*/
+ /** Construct a CCSID based on a CCSID specification. */
+ CCSID(long lCCSID);
+ /** Construct a CCSID based on a CCSID specification as a C string. */
+ CCSID(const char * cpszCCSID);
+ /*@}*/
+ /* --- functions --- */
+ /* --- functions --- */
+ /* BASE CONSTRUCTOR NOT SUPPORTED */
+ CCSID(void); //lint !e1704
+ }
+ ; /* CCSID */
+}
+
+/* ----------------------------------------------------------------------- */
+/* Implementation */
+/* ----------------------------------------------------------------------- */
+
+namespace uima {
+
+ /* static */
+ inline char const * CCSID::getDefaultName( void ) {
+ return ucnv_getDefaultName();
+ }
+
+ // Assume ASII, not EBCDIC!
+
+ /*static */
+ inline char const * CCSID::getDefaultSBCSInputCCSID( void ) {
+ return "UTF-8";
+ }
+ /*static */
+ inline char const * CCSID::getDefaultSBCSOutputCCSID( void ) {
+ return "ibm-819";
+ }
+
+} //namespace uima
+
+#endif /* UIMA_CCSID_HPP */
+
+/* <EOF> */
+
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/ccsid.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/comp_ids.h
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/comp_ids.h?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/comp_ids.h (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/comp_ids.h Sat Feb 3 08:58:54 2007
@@ -0,0 +1,92 @@
+/** \file comp_ids.h .
+-----------------------------------------------------------------------------
+
+
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-----------------------------------------------------------------------------
+
+ \brief Component Ids for UIMACPP trace facility
+
+-------------------------------------------------------------------------- */
+
+#ifndef UIMA_COMP_IDS_H
+#define UIMA_COMP_IDS_H
+
+/* ----------------------------------------------------------------------- */
+/* Interface dependencies */
+/* ----------------------------------------------------------------------- */
+
+#include "uima/pragmas.hpp" // must be first file to be included to get pragmas
+#include "uima/types.h"
+
+// first arg: a util::Trace object, second arg: a "stream expression" like: "message: " << us
+#include <sstream>
+#define UIMA_TRACE_STREAM(trace, x) \
+ if (trace.isEnabled()) { \
+ std::stringstream _s; \
+ _s << x; _s.flush(); \
+ trace.dump( _s.str().c_str(), "" ); \
+ }
+
+#define UIMA_TRACE_STREAM_ARG(trace, x, y) \
+ if (trace.isEnabled()) { \
+ std::stringstream _s1; \
+ _s1 << x; _s1.flush(); \
+ std::stringstream _s2; \
+ _s2 << y; _s2.flush(); \
+ trace.dump( _s1.str().c_str(), _s2.str().c_str() ); \
+ }
+
+/* ----------------------------------------------------------------------- */
+/* Constants */
+/* ----------------------------------------------------------------------- */
+
+/** @name Trace Component Ids
+ user-defined component ids must be in the range
+ UIMA_TRACE_COMPONENT_ID_FIRST .. UIMA_TRACE_COMPONENT_ID_LAST */
+/*@{*/
+/** \internal Internal Use Only! do not use! */
+#define UIMA_TRACE_COMPONENT_ID_UNDEFINED ((uima::TyComponentId) 0x00)
+/** first trace component id available to user */
+#define UIMA_TRACE_COMPONENT_ID_FIRST ((uima::TyComponentId) 0x01)
+/** last trace component id available to user */
+#define UIMA_TRACE_COMPONENT_ID_LAST ((uima::TyComponentId) 0xFF)
+/*@}*/
+
+/* NOTE: UIMA_TRACE_COMPONENT_ID_FIRST is equal to 1 */
+#define UIMA_TRACE_COMPID_EXCEPTIONS ((uima::TyComponentId) ( 0 + UIMA_TRACE_COMPONENT_ID_FIRST))
+#define UIMA_TRACE_COMPID_ENGINE ((uima::TyComponentId) ( 1 + UIMA_TRACE_COMPONENT_ID_FIRST))
+#define UIMA_TRACE_COMPID_RESOURCE_MGR ((uima::TyComponentId) ( 2 + UIMA_TRACE_COMPONENT_ID_FIRST))
+#define UIMA_TRACE_COMPID_ANNOTATOR_MGR ((uima::TyComponentId) ( 3 + UIMA_TRACE_COMPONENT_ID_FIRST))
+#define UIMA_TRACE_COMPID_LOG_FACILITY ((uima::TyComponentId) ( 4 + UIMA_TRACE_COMPONENT_ID_FIRST))
+#define UIMA_TRACE_COMPID_TIMING ((uima::TyComponentId) ( 5 + UIMA_TRACE_COMPONENT_ID_FIRST))
+
+/* UIMACPP provided Annotators should use reserved area 151..199 */
+#define UIMA_TRACE_COMPID_ANNOTATOR_DEFAULT ((uima::TyComponentId) (150 + UIMA_TRACE_COMPONENT_ID_FIRST))
+
+/* User Annotators should use reserved area 201..255 */
+/* Note: comp ids for user annotator must be user configurable through configuration */
+#define UIMA_TRACE_COMPID_USER_FIRST ((uima::TyComponentId) (200 + UIMA_TRACE_COMPONENT_ID_FIRST))
+#define UIMA_TRACE_COMPID_USER_LAST ((uima::TyComponentId) (254 + UIMA_TRACE_COMPONENT_ID_FIRST))
+
+#endif /* UIMA_COMP_IDS_H */
+
+/* <EOF> */
+
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/comp_ids.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/config_param.hpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/config_param.hpp?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/config_param.hpp (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/config_param.hpp Sat Feb 3 08:58:54 2007
@@ -0,0 +1,369 @@
+/** \file config_param.hpp .
+-----------------------------------------------------------------------------
+
+
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-----------------------------------------------------------------------------
+
+ \brief MetaDataObjects for configuration parameters and values
+
+ Description:
+
+-----------------------------------------------------------------------------
+
+
+ 01/30/2003 Initial creation
+
+-------------------------------------------------------------------------- */
+#ifndef UIMA_CONFIG_PARAM_HPP
+#define UIMA_CONFIG_PARAM_HPP
+// ---------------------------------------------------------------------------
+// Includes
+// ---------------------------------------------------------------------------
+
+#include "uima/pragmas.hpp" //must be first to surpress warnings
+#include "uima/err_ids.h"
+#include "uima/taemetadata.hpp"
+#include "uima/strconvert.hpp"
+#include "uima/exceptions.hpp"
+#include <map>
+namespace uima {
+ UIMA_EXC_CLASSDECLARE(ConfigException, Exception);
+ UIMA_EXC_CLASSDECLARE(ConfigParamException, ConfigException);
+
+ /**
+ * Contains the definition of a configuration parameter, for example
+ * its name and its type.
+ */
+ class UIMA_LINK_IMPORTSPEC ConfigurationParameter : public MetaDataObject {
+ public:
+ enum EnParameterType {
+ STRING, INTEGER, FLOAT, BOOLEAN
+ };
+ enum EnParameterAggregation {
+ SINGLE_VALUE = false, MULTIPLE_VALUES = true
+ };
+ ConfigurationParameter()
+ :MetaDataObject(), iv_name(), iv_description(), iv_enParamAggregation(SINGLE_VALUE),
+ iv_mandatory(false), iv_vecRestrictedToDelegates() {}
+
+
+ TyErrorId setName(const icu::UnicodeString & name) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+ iv_name = name;
+ return UIMA_ERR_NONE;
+ }
+
+ const icu::UnicodeString & getName() const {
+ return iv_name;
+ }
+
+ TyErrorId setDescription(const icu::UnicodeString & description) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+ iv_description = description;
+ return UIMA_ERR_NONE;
+ }
+
+ const icu::UnicodeString & getDescription() const {
+ return iv_description;
+ }
+
+ TyErrorId setType(EnParameterType enParamType) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+ iv_enParamType = enParamType;
+ return UIMA_ERR_NONE;
+ }
+
+ EnParameterType getType() const {
+ return iv_enParamType;
+ }
+
+ TyErrorId setMultiValued(EnParameterAggregation enMode) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+ iv_enParamAggregation = enMode;
+ return UIMA_ERR_NONE;
+ }
+
+ bool isMultiValued() const {
+ return(iv_enParamAggregation == MULTIPLE_VALUES);
+ }
+
+ TyErrorId setMandatory(bool man) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+ iv_mandatory = man;
+ return UIMA_ERR_NONE;
+ }
+
+ bool isMandatory() const {
+ return iv_mandatory;
+ }
+
+ /**
+ * Returns true iff settings for this configuration parameter
+ * will only be visible to certain delegate TAEs
+ **/
+ /* bool hasRestrictions() const{ */
+ /* return(iv_vecRestrictedToDelegates.size() != 0); */
+ /* } */
+
+ /**
+ * Settings for this configuration parameter will only be visible
+ * for the delegate AnC <code>delegateName</code>
+ **/
+ TyErrorId addRestriction(const icu::UnicodeString & delegateName) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+
+ iv_vecRestrictedToDelegates.push_back(delegateName);
+ return UIMA_ERR_NONE;
+ }
+
+ bool isDefinedForAnnotatorContext(const icu::UnicodeString & ancKey) const;
+
+ /**
+ * @return The names for the delegate TAEs which are possibly affected by
+ * setting this parameter. If the vector is empty, all delegates
+ * are possibly affected.
+ **/
+ /* const std::vector<icu::UnicodeString> & getRestrictions() const{ */
+ /* return iv_vecRestrictedToDelegates; */
+ /* } */
+
+ private:
+ icu::UnicodeString iv_name;
+ icu::UnicodeString iv_description;
+ EnParameterType iv_enParamType;
+ EnParameterAggregation iv_enParamAggregation;
+ bool iv_mandatory;
+ std::vector<icu::UnicodeString> iv_vecRestrictedToDelegates;
+
+
+ }
+ ; /* ConfigurationParameter */
+
+ /**
+ * Contains the value for a certain parameter. The parameter name is determined
+ * by<code>getName()</code>.
+ * Has several<code>extractValue</code>methods to extract the value according
+ * to its type. These methods will return<code>UIMA_ERR_CONFIG_INVALID_EXRACTOR_FOR_TYPE</code>
+ * if the value type does not match the type in the<code>extractValue</code>method.
+ **/
+ class UIMA_LINK_IMPORTSPEC NameValuePair : public MetaDataObject {
+
+ public:
+ typedef std::vector < icu::UnicodeString > TyStrValueList;
+ typedef std::vector < int > TyIntValueList;
+ typedef std::vector < float > TyFloatValueList;
+ typedef std::vector < bool > TyBoolValueList;
+
+ NameValuePair();
+ /**
+ * Does nothing, as reconfiguration of parameter values is possible
+ **/
+ void commit() {}
+
+ void setName(const icu::UnicodeString & name) {
+ iv_name = name;
+ }
+
+ const icu::UnicodeString & getName() const {
+ return iv_name;
+ }
+
+ void define(ConfigurationParameter::EnParameterType type, ConfigurationParameter::EnParameterAggregation enIsMulti);
+
+ bool isMultiValued() const {
+ return(iv_enAggregation == ConfigurationParameter::MULTIPLE_VALUES);
+ }
+
+ ConfigurationParameter::EnParameterType getType() const {
+ return iv_enType;
+ }
+
+ // for single value
+ TyErrorId setValue(int value);
+ TyErrorId setValue(float value);
+ TyErrorId setValue(bool value);
+ TyErrorId setValue(const icu::UnicodeString & value);
+ // for multiple value
+ TyErrorId addValue(int value);
+ TyErrorId addValue(float value);
+ TyErrorId addValue(bool value);
+ TyErrorId addValue(const icu::UnicodeString & value);
+
+ bool extractBoolValue() const;
+ vector<bool> const & extractBoolValues() const;
+
+ int extractIntValue() const;
+ vector<int> const & extractIntValues() const;
+
+ float extractFloatValue() const;
+ vector<float> const & extractFloatValues() const;
+
+ icu::UnicodeString const & extractStringValue() const;
+ vector<icu::UnicodeString> const & extractStringValues() const;
+
+ //Returns a UTF-8 string
+ std::string extractSingleByteStringValue() const;
+ //converts array of values from UTF-16 to UTF-8
+ //Caller assumes memory ownership of string objects in vector
+ void extractSingleByteStringValues( vector<std::string*> & values) const;
+
+
+ private:
+ size_t size() const;
+ void ensureType(ConfigurationParameter::EnParameterType t) const;
+ void ensureSingleValue() const;
+ void ensureMultipleValues() const;
+ void reset();
+ std::string convert(const icu::UnicodeString & value) const;
+
+ icu::UnicodeString iv_name;
+ ConfigurationParameter::EnParameterType iv_enType;
+ ConfigurationParameter::EnParameterAggregation iv_enAggregation;
+ TyStrValueList iv_strValues;
+ TyIntValueList iv_intValues;
+ TyFloatValueList iv_fltValues;
+ TyBoolValueList iv_boolValues;
+ };
+
+ /**
+ * Contains all<code>ConfigurationParameter</code>objects for a certain configuration group.
+ **/
+ class UIMA_LINK_IMPORTSPEC ConfigurationGroup:public MetaDataObject {
+ public:
+ ConfigurationGroup()
+ :MetaDataObject(), iv_configParams() {}
+
+ ~ConfigurationGroup();
+
+ void commit() {
+ map<icu::UnicodeString, ConfigurationParameter *>::iterator entries;
+ for (entries = iv_configParams.begin(); entries != iv_configParams.end(); entries++) {
+ entries->second->commit();
+ }
+ }
+
+ /**
+ * Note: This object will assume memory ownership of<code>param</code>and will delete it in its
+ * destructor !
+ **/
+ TyErrorId addConfigurationParameter(ConfigurationParameter * param) {
+ if (! isModifiable()) {
+ return UIMA_ERR_CONFIG_OBJECT_COMITTED;
+ }
+ iv_configParams[param->getName()] = param;
+ return UIMA_ERR_NONE;
+ }
+
+ /**
+ * returns TRUE iff a configuration parameter<code>paramName</code>exists in this group.
+ **/
+ bool hasConfigurationParameter(const icu::UnicodeString & paramName) const {
+ map<icu::UnicodeString, ConfigurationParameter *>::const_iterator ite = iv_configParams.find(paramName);
+ return(ite != iv_configParams.end());
+ }
+
+ /**
+ * returns the <code>ConfigurationParameter</code> with name <code>paramName</code> or NULL
+ * if no such parameter is found.
+ **/
+ const ConfigurationParameter * getConfigurationParameter(const icu::UnicodeString & paramName) const {
+ map<icu::UnicodeString, ConfigurationParameter *>::const_iterator ite = iv_configParams.find(paramName);
+ if (ite != iv_configParams.end()) {
+ return ite->second;
+ } else {
+ return NULL;
+ }
+ }
+
+ const vector <const ConfigurationParameter *> getConfigurationParameters() const;
+
+ private:
+ map<icu::UnicodeString, ConfigurationParameter *> iv_configParams;
+
+ };
+
+ /**
+ * Contains all<code>NameValuePair</code>objects for a certain configuration group.
+ **/
+ class UIMA_LINK_IMPORTSPEC SettingsForGroup : public MetaDataObject {
+ public:
+ SettingsForGroup()
+ :MetaDataObject(), iv_nameValuePairs() {}
+
+ ~SettingsForGroup() {
+ map<icu::UnicodeString, NameValuePair *>::iterator entries = iv_nameValuePairs.begin();
+ while (entries != iv_nameValuePairs.end()) {
+ delete (*entries).second;
+ entries++;
+ }
+
+ }
+
+ /**
+ * Does nothing, as reconfiguration of parameter values is possible
+ **/
+ void commit() {}
+
+ /**
+ * Note: This object will assume memory ownership of<code>nvPair</code>and will delete it in its
+ * destructor !
+ **/
+ void addNameValuePair(NameValuePair * nvPair) {
+ NameValuePair * oldPair = getNameValuePair(nvPair->getName());
+ if (EXISTS(oldPair)) {
+ delete oldPair;
+ }
+ iv_nameValuePairs[nvPair->getName()] = nvPair;
+ }
+
+ /**
+ * Returns the<code>NameValuePair</code>whose name equals<code>paramName</code>or NULL if no such object can be found.
+ **/
+ NameValuePair * getNameValuePair(const icu::UnicodeString & paramName) const {
+ map<icu::UnicodeString, NameValuePair *>::const_iterator ite = iv_nameValuePairs.find(paramName);
+ if (ite == iv_nameValuePairs.end()) {
+ return NULL;
+ } else {
+ return(*ite).second;
+ }
+ }
+
+ vector<NameValuePair const *> getNameValuePairs() const;
+
+ private:
+ map<icu::UnicodeString, NameValuePair *> iv_nameValuePairs;
+ };
+
+
+} // namespace uima
+#endif
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/config_param.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/config_tools.hpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/config_tools.hpp?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/config_tools.hpp (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/config_tools.hpp Sat Feb 3 08:58:54 2007
@@ -0,0 +1,380 @@
+#ifndef UIMA_CONFIG_TOOLS_HPP
+#define UIMA_CONFIG_TOOLS_HPP
+/** \file config_tools.hpp .
+-----------------------------------------------------------------------------
+
+
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-----------------------------------------------------------------------------
+
+ \brief Contains ConfigBase
+
+ Description:
+
+-----------------------------------------------------------------------------
+
+
+ Initial creation:
+
+-------------------------------------------------------------------------- */
+
+
+/* ----------------------------------------------------------------------- */
+/* Include dependencies */
+/* ----------------------------------------------------------------------- */
+
+#include "uima/pragmas.hpp"
+#include "uima/strconvert.hpp" // for string conversion functions
+#include "uima/stltools.hpp"
+#include "uima/strtools.hpp"
+#include "uima/annotator_context.hpp"
+
+/* ----------------------------------------------------------------------- */
+/* Constants */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Forward declarations */
+/* ----------------------------------------------------------------------- */
+
+
+/* ----------------------------------------------------------------------- */
+/* Types / Classes */
+/* ----------------------------------------------------------------------- */
+
+namespace uima {
+
+
+
+ /**
+ A little helper class to provide to tools you need to be able to
+ define "constants" in you source code for each config option an
+ application/annotator accesses.
+ */
+ class UIMA_LINK_IMPORTSPEC ConfigOptionInfo {
+ public:
+ /// Enum to be used with struct <TT>StConfigOptionInfo</TT> below
+ enum EnValueType {
+ // Integral Number
+ enValueType_IntegralNumber,
+ // Real Number
+ enValueType_RealNumber,
+ // String
+ enValueType_String,
+ // Boolean
+ enValueType_Boolean
+ };
+
+ /**
+ This struct can be used by annotators and applications to keep track of
+ all the options they access in the configuration.
+ They can create a constant array as a table of of all config options.
+ Example:
+ \code
+ \endcode
+ */
+ typedef struct StOptionInfo_ {
+ const TCHAR * cpszOptionName;
+ EnValueType enValueType;
+ bool bOptionIsMultiValued;
+ size_t uiNbrOfValuesRequired;
+ const TCHAR * cpszDefaultValueAsString;
+ const TCHAR * cpszComment;
+ }
+ StOptionInfo;
+ }
+ ; // ConfigOptionInfo
+
+ /**
+ This function takes an <TT>ConfigOptionInfo::StOptionInfo</TT>
+ and uses the information in it to extract the value from the
+ config into the output parameter <TT>rclTargetVariable</TT>.
+ <TT>crclOptionInfo.bOptionIsMultiValued</TT> is required to be false.
+ This function should realy be a (template) member function of class
+ <TT>ConfigOptionInfo</TT> above, but our compiler can't do that right now.
+ */
+ template < class T >
+ TyErrorId
+ extractConfigOption(
+ const AnnotatorContext & crclConfig,
+ const ConfigOptionInfo::StOptionInfo & crclOptionInfo,
+ T & rclTargetVariable
+ ) {
+ return extractConfigOption(crclConfig, NULL, crclOptionInfo, rclTargetVariable);
+ /* assert(!crclOptionInfo.bOptionIsMultiValued); */
+ /* // assume the worst */
+ /* TyErrorId utErrId = UIMA_ERR_CONFIG_SECTION_NOT_FOUND; */
+ /* assert(crclOptionInfo.uiNbrOfValuesRequired <= 1); */
+ /* utErrId = crclConfig.extractValue(crclOptionInfo.cpszOptionName, rclTargetVariable); */
+ /* if (utErrId != UIMA_ERR_NONE) { // could not find option or value(s) */
+ /* if ( crclOptionInfo.uiNbrOfValuesRequired != 0 */
+ /* || crclOptionInfo.cpszDefaultValueAsString == NULL) { */
+ /* // required value not there: return error we got from config */
+ /* return utErrId; */
+ /* } */
+ /* convertFromString((string)crclOptionInfo.cpszDefaultValueAsString, rclTargetVariable); */
+ /* // we used the provided default: this is not an error so we return OK */
+ /* utErrId = UIMA_ERR_NONE; */
+ /* } */
+ /* return utErrId; */
+ }
+
+ /**
+ This function takes an <TT>ConfigOptionInfo::StOptionInfo</TT>
+ and uses the information in it to extract the value from the
+ config of group <code>crclConfigGroup</code> into the output parameter <TT>rclTargetVariable</TT>.
+ If <code>crclConfigGroup == NULL</code>, extracts the default value from the config.
+ <TT>crclOptionInfo.bOptionIsMultiValued</TT> is required to be false.
+ This function should really be a (template) member function of class
+ <TT>ConfigOptionInfo</TT> above, but our compiler can't do that right now.
+ */
+
+ template < class T >
+ TyErrorId
+ extractConfigOption(
+ const AnnotatorContext & crclConfig,
+ const icu::UnicodeString * cpclConfigGroup,
+ const ConfigOptionInfo::StOptionInfo & crclOptionInfo,
+ T & rclTargetVariable
+ ) {
+ assert(!crclOptionInfo.bOptionIsMultiValued);
+ // assume the worst
+ TyErrorId utErrId = UIMA_ERR_CONFIG_SECTION_NOT_FOUND;
+ assert(crclOptionInfo.uiNbrOfValuesRequired <= 1);
+ if (EXISTS(cpclConfigGroup)) {
+ //utErrId = crclConfig.extractValue(crclOptionInfo.cpszOptionName, rclTargetVariable);
+ utErrId = crclConfig.extractValue(*cpclConfigGroup, crclOptionInfo.cpszOptionName, rclTargetVariable);
+ } else {
+ utErrId = crclConfig.extractValue(crclOptionInfo.cpszOptionName, rclTargetVariable);
+ }
+ if (utErrId != UIMA_ERR_NONE) { // could not find option or value(s)
+ if ( crclOptionInfo.uiNbrOfValuesRequired != 0
+ || crclOptionInfo.cpszDefaultValueAsString == NULL) {
+ // required value not there: return error we got from config
+ return utErrId;
+ }
+ convertFromString((string)crclOptionInfo.cpszDefaultValueAsString, rclTargetVariable);
+ // we used the provided default: this is not an error so we return OK
+ utErrId = UIMA_ERR_NONE;
+ }
+ return utErrId;
+ }
+
+ /**
+ Version of <TT>ExtractConfigOption</TT> for boolean values.
+ */
+ inline TyErrorId
+ extractConfigOptionBoolean(
+ const AnnotatorContext & crclConfig,
+ const ConfigOptionInfo::StOptionInfo & crclOptionInfo,
+ bool & rclTargetVariable
+ ) {
+ assert(crclOptionInfo.enValueType == ConfigOptionInfo::enValueType_Boolean);
+// BoolValue clBool(rclTargetVariable);
+ TyErrorId utErrId = extractConfigOption(crclConfig, crclOptionInfo, rclTargetVariable);
+// rclTargetVariable = clBool;
+ return utErrId;
+ }
+
+ /**
+ Version of <TT>ExtractConfigOption</TT> for boolean values.
+ */
+ inline TyErrorId
+ extractConfigOptionBoolean(
+ const AnnotatorContext & crclConfig,
+ const icu::UnicodeString * cpclConfigGroup ,
+ const ConfigOptionInfo::StOptionInfo & crclOptionInfo,
+ bool & rclTargetVariable
+ ) {
+ assert(crclOptionInfo.enValueType == ConfigOptionInfo::enValueType_Boolean);
+// BoolValue clBool(rclTargetVariable);
+ TyErrorId utErrId = extractConfigOption(crclConfig, cpclConfigGroup, crclOptionInfo, rclTargetVariable);
+// rclTargetVariable = clBool;
+ return utErrId;
+ }
+
+ template < class ContainerType, class ElementType >
+ TyErrorId
+ extractConfigOptionListImpl(
+ const AnnotatorContext & crclConfig,
+ const ConfigOptionInfo::StOptionInfo & crclOptionInfo,
+ ContainerType & rclTargetContainer,
+ ElementType * pElem /*not used, just for type information since ContainerType::value_type does not work with HP compiler*/
+ ) {
+ return extractConfigOptionListImpl(crclConfig, NULL, crclOptionInfo, rclTargetContainer, pElem);
+ /* assert(crclOptionInfo.bOptionIsMultiValued); */
+ /* TyErrorId utErrId = UIMA_ERR_NONE; */
+ /* size_t i; */
+ /* #if defined(__HPX_ACC__) || defined(__xlC__) || defined(__GNUC__) */
+ /* ElementType tTemp; */
+ /* #else */
+ /* ContainerType::value_type tTemp; */
+ /* #endif */
+ /* */
+ /* vector<ElementType> elements; */
+ /* crclConfig.extractValue(crclOptionInfo.cpszOptionName, elements); */
+ /* for (i=0; i<elements.size(); ++i) { */
+ /* rclTargetContainer.insert(rclTargetContainer.end(), elements[i]); */
+ /* } */
+ /* */
+ /* if (utErrId != UIMA_ERR_NONE || (elements.size() == 0 )) { // could not find option or value(s) */
+ /* if ( crclOptionInfo.uiNbrOfValuesRequired != 0 */
+ /* || crclOptionInfo.cpszDefaultValueAsString == NULL) { */
+ /* // required value not there: return error we got from config */
+ /* return utErrId; */
+ /* } */
+ /* vector< string > vecTmpStrings; */
+ /* delimitedString2Vector( */
+ /* vecTmpStrings, */
+ /* (string)crclOptionInfo.cpszDefaultValueAsString, */
+ /* ",", */
+ /* true, // trim strings */
+ /* false // insert empty strings */
+ /* ); */
+ /* // our default value too must have the required nbr of values */
+ /* assert(vecTmpStrings.size() >= crclOptionInfo.uiNbrOfValuesRequired); */
+ /* */
+ /* for (i = 0; i < vecTmpStrings.size(); ++i) { */
+ /* convertFromString(vecTmpStrings[i], tTemp); */
+ /* // assumes rclTargetContainer to be an STL container */
+ /* rclTargetContainer.insert(rclTargetContainer.end(), tTemp); */
+ /* } */
+ /* } */
+ /* if (i < crclOptionInfo.uiNbrOfValuesRequired) { */
+ /* taph 8/6/1999: ?? maybe we should have a more precise error id: */
+ /* UIMA_ERR_CONFIG_REQUIRED_OPTION_HAS_NOT_ENOUGH_VALUES */
+ /* */
+ /* return UIMA_ERR_CONFIG_REQUIRED_OPTION_IS_EMPTY; */
+ /* } */
+ /* return utErrId; */
+ }
+
+ template < class ContainerType, class ElementType >
+ TyErrorId
+ extractConfigOptionListImpl(
+ const AnnotatorContext & crclConfig,
+ const icu::UnicodeString * cpclConfigGroup,
+ const ConfigOptionInfo::StOptionInfo & crclOptionInfo,
+ ContainerType & rclTargetContainer,
+ ElementType * /*not used, just for type information since ContainerType::value_type does not work with HP compiler*/
+ ) {
+ assert(crclOptionInfo.bOptionIsMultiValued);
+ TyErrorId utErrId = UIMA_ERR_NONE;
+ size_t i;
+#if defined(__HPX_ACC__) || defined(__xlC__) || defined(__GNUC__)
+ ElementType tTemp;
+#else
+ ContainerType::value_type tTemp;
+#endif
+
+#if defined(__SUNPRO_CC)
+ vector<ContainerType::value_type> elements;
+#else
+ vector<ElementType> elements;
+#endif
+
+ if (EXISTS(cpclConfigGroup)) {
+ crclConfig.extractValue(*cpclConfigGroup, crclOptionInfo.cpszOptionName, elements);
+ } else {
+ crclConfig.extractValue(crclOptionInfo.cpszOptionName, elements);
+ }
+
+ for (i=0; i<elements.size(); ++i) {
+ rclTargetContainer.insert(rclTargetContainer.end(), elements[i]);
+ }
+
+ if (utErrId != UIMA_ERR_NONE || (elements.size() == 0 )) { // could not find option or value(s)
+ if ( crclOptionInfo.uiNbrOfValuesRequired != 0
+ || crclOptionInfo.cpszDefaultValueAsString == NULL) {
+ // required value not there: return error we got from config
+ return utErrId;
+ }
+ vector< string > vecTmpStrings;
+ delimitedString2Vector(
+ vecTmpStrings,
+ (string)crclOptionInfo.cpszDefaultValueAsString,
+ ",",
+ true, // trim strings
+ false // insert empty strings
+ );
+ // our default value too must have the required nbr of values
+ assert(vecTmpStrings.size() >= crclOptionInfo.uiNbrOfValuesRequired);
+
+ for (i = 0; i < vecTmpStrings.size(); ++i) {
+ convertFromString(vecTmpStrings[i], tTemp);
+ // assumes rclTargetContainer to be an STL container
+ rclTargetContainer.insert(rclTargetContainer.end(), tTemp);
+ }
+ }
+ if (i < crclOptionInfo.uiNbrOfValuesRequired) {
+ /* taph 8/6/1999: ?? maybe we should have a more precise error id:
+ UIMA_ERR_CONFIG_REQUIRED_OPTION_HAS_NOT_ENOUGH_VALUES
+ */
+ return UIMA_ERR_CONFIG_REQUIRED_OPTION_IS_EMPTY;
+ }
+ return utErrId;
+ }
+
+ /**
+ This function takes an <TT>ConfigOptionInfo::StOptionInfo</TT>
+ and uses the information in it to extract multiple values from the
+ config into the output parameter <TT>rclTargetContainer</TT>.
+ This works for config values with more than one value.
+ <TT>rclTargetContainer</TT> is assumed to be an STL container.
+ <TT>crclOptionInfo.bOptionIsMultiValued</TT> is required to be true.
+ This function should realy be a (template) member function of class
+ <TT>ConfigOptionInfo</TT> above, but our compiler can't do that right now.
+ */
+ template < class ContainerType >
+ inline TyErrorId
+ extractConfigOptionList(
+ const AnnotatorContext & crclConfig,
+ const ConfigOptionInfo::StOptionInfo & crclOptionInfo,
+ ContainerType & rclTargetContainer
+ ) {
+ return extractConfigOptionListImpl(crclConfig, crclOptionInfo, rclTargetContainer, STL_ITER2PTR(rclTargetContainer.begin()));
+ }
+
+ /**
+ This function takes an <TT>ConfigOptionInfo::StOptionInfo</TT>
+ and uses the information in it to extract multiple values from the
+ config of group <code>crclConfigGroup</code> into the output parameter <TT>rclTargetContainer</TT>.
+ This works for config values with more than one value.
+ <TT>rclTargetContainer</TT> is assumed to be an STL container.
+ <TT>crclOptionInfo.bOptionIsMultiValued</TT> is required to be true.
+ This function should realy be a (template) member function of class
+ <TT>ConfigOptionInfo</TT> above, but our compiler can't do that right now.
+ */
+ template < class ContainerType >
+ inline TyErrorId
+ extractConfigOptionList(
+ const AnnotatorContext & crclConfig,
+ const icu::UnicodeString * cpclConfigGroup,
+ const ConfigOptionInfo::StOptionInfo & crclOptionInfo,
+ ContainerType & rclTargetContainer
+ ) {
+ return extractConfigOptionListImpl(crclConfig, cpclConfigGroup, crclOptionInfo, rclTargetContainer, STL_ITER2PTR(rclTargetContainer.begin()));
+ }
+
+}
+
+#endif /* UIMA_CONFIG_TOOLS_HPP */
+/* <EOF> */
+
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/config_tools.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/uima/uimacpp/trunk/src/framework/uima/configure.h
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/framework/uima/configure.h?view=auto&rev=503251
==============================================================================
--- incubator/uima/uimacpp/trunk/src/framework/uima/configure.h (added)
+++ incubator/uima/uimacpp/trunk/src/framework/uima/configure.h Sat Feb 3 08:58:54 2007
@@ -0,0 +1,84 @@
+/** \file configure.h .
+-----------------------------------------------------------------------------
+
+
+
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+
+-----------------------------------------------------------------------------
+
+ \brief Contains compiler dependent configuration defines.
+
+ Description:
+
+-----------------------------------------------------------------------------
+
+
+ 12/13/2001 Initial creation
+
+-------------------------------------------------------------------------- */
+
+#ifndef UIMA_CONFIGURE_H
+#define UIMA_CONFIGURE_H
+
+/* ----------------------------------------------------------------------- */
+/* Interface dependencies */
+/* ----------------------------------------------------------------------- */
+
+
+/* ----------------------------------------------------------------------- */
+/* Defines */
+/* ----------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/* Compiler dependencies */
+/* ----------------------------------------------------------------------- */
+
+#if defined(__GNUC__)
+
+#elif defined(_MSC_VER)
+# define UIMA_COMP_REQ_PUBLIC_TYPES
+# define UIMA_NO_HASH_CONTAINERS_SUPPORTED
+# include <minmax.h> // for min
+// Disable MS warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+# pragma warning(disable:4290)
+
+#else
+# error Code requires port to host OS!
+#endif
+
+#define UIMA_THROW0() throw()
+#define UIMA_THROW(x1) throw(x1)
+
+
+#ifdef __cplusplus
+#include <string>
+using namespace std;
+#endif
+
+#ifndef U_OVERRIDE_CXX_ALLOCATION
+// this is a ICU define
+// since we currently do not support alternative memory management we put it here
+# define U_OVERRIDE_CXX_ALLOCATION 0
+#endif
+
+/* ----------------------------------------------------------------------- */
+#endif /* UIMA_CONFIGURE_H */
+
+/* <EOF> */
+
Propchange: incubator/uima/uimacpp/trunk/src/framework/uima/configure.h
------------------------------------------------------------------------------
svn:eol-style = native