]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/rbbidata.h
ICU-59173.0.1.tar.gz
[apple/icu.git] / icuSources / common / rbbidata.h
index 7ba1db05d655a19eb608b491754ac7c161365088..8011bafd56bf83ca130fa2a00d413fc1391ead42 100644 (file)
@@ -1,12 +1,14 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1999-2005, International Business Machines
+*   Copyright (C) 1999-2014 International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
 *   file name:  rbbidata.h
-*   encoding:   US-ASCII
+*   encoding:   UTF-8
 *   tab size:   8 (not used)
 *   indentation:4
 *
@@ -45,10 +47,11 @@ ubrk_swap(const UDataSwapper *ds,
           const void *inData, int32_t length, void *outData,
           UErrorCode *pErrorCode);
 
-#ifdef XP_CPLUSPLUS
+#ifdef __cplusplus
 
 #include "unicode/uobject.h"
 #include "unicode/unistr.h"
+#include "umutex.h"
 #include "utrie.h"
 
 U_NAMESPACE_BEGIN
@@ -113,8 +116,8 @@ struct  RBBIStateTableRow {
                                     /*     tags (rule status values)                      */
     int16_t          fReserved;
     uint16_t         fNextState[2]; /*  Next State, indexed by char category.             */
-                                    /*    Array Size is fNumCols from the                 */
-                                    /*    state table header.                             */
+                                    /*  This array does not have two elements             */
+                                    /*    Array Size is actually fData->fHeader->fCatCount         */
                                     /*    CAUTION:  see RBBITableBuilder::getTableSize()  */
                                     /*              before changing anything here.        */
 };
@@ -141,10 +144,15 @@ typedef enum {
 /*                                        */
 class RBBIDataWrapper : public UMemory {
 public:
+    enum EDontAdopt {
+        kDontAdopt
+    };
     RBBIDataWrapper(const RBBIDataHeader *data, UErrorCode &status);
+    RBBIDataWrapper(const RBBIDataHeader *data, enum EDontAdopt dontAdopt, UErrorCode &status);
     RBBIDataWrapper(UDataMemory* udm, UErrorCode &status);
     ~RBBIDataWrapper();
 
+    void                  init0();
     void                  init(const RBBIDataHeader *data, UErrorCode &status);
     RBBIDataWrapper      *addReference();
     void                  removeReference();
@@ -176,9 +184,10 @@ public:
     UTrie               fTrie;
 
 private:
-    int32_t             fRefCount;
-    UDataMemory        *fUDataMem;
+    u_atomic_int32_t    fRefCount;
+    UDataMemory  *fUDataMem;
     UnicodeString       fRuleString;
+    UBool               fDontFreeData;
 
     RBBIDataWrapper(const RBBIDataWrapper &other); /*  forbid copying of this class */
     RBBIDataWrapper &operator=(const RBBIDataWrapper &other); /*  forbid copying of this class */