+ /**
+ * Returns the count of soft references only.
+ * Must be called only from within the internals of UnifiedCache and
+ * only while the cache global mutex is held.
+ */
+ int32_t getSoftRefCount() const { return softRefCount; }
+
+ /**
+ * Returns the count of hard references only. Uses a memory barrier.
+ * Used for testing the cache. Regular clients won't need this.
+ */
+ int32_t getHardRefCount() const;
+
+ /**
+ * If noHardReferences() == TRUE then this object has no hard references.
+ * Must be called only from within the internals of UnifiedCache.
+ */
+ inline UBool noHardReferences() const { return getHardRefCount() == 0; }
+
+ /**
+ * If hasHardReferences() == TRUE then this object has hard references.
+ * Must be called only from within the internals of UnifiedCache.
+ */
+ inline UBool hasHardReferences() const { return getHardRefCount() != 0; }
+
+ /**
+ * If noSoftReferences() == TRUE then this object has no soft references.
+ * Must be called only from within the internals of UnifiedCache and
+ * only while the cache global mutex is held.
+ */
+ UBool noSoftReferences() const { return (softRefCount == 0); }
+
+ /**
+ * Deletes this object if it has no references or soft references.
+ */