+/**
+ * Base class for unified cache exposing enough methods to SharedObject
+ * instances to allow their addRef() and removeRef() methods to
+ * update cache metrics. No other part of ICU, except for SharedObject,
+ * should directly call the methods of this base class.
+ */
+class U_COMMON_API UnifiedCacheBase : public UObject {
+public:
+ UnifiedCacheBase() { }
+
+ /**
+ * Called by addRefWhileHoldingCacheLock() when the hard reference count
+ * of its instance goes from 0 to 1.
+ */
+ virtual void incrementItemsInUse() const = 0;
+
+ /**
+ * Called by removeRef() when the hard reference count of its instance
+ * drops from 1 to 0.
+ */
+ virtual void decrementItemsInUseWithLockingAndEviction() const = 0;
+
+ /**
+ * Called by removeRefWhileHoldingCacheLock() when the hard reference
+ * count of its instance drops from 1 to 0.
+ */
+ virtual void decrementItemsInUse() const = 0;
+ virtual ~UnifiedCacheBase();
+private:
+ UnifiedCacheBase(const UnifiedCacheBase &);
+ UnifiedCacheBase &operator=(const UnifiedCacheBase &);
+};
+