[arrays] Move Supplier<> to hb-array.hh
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 17 Dec 2018 04:38:51 +0000 (23:38 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 17 Dec 2018 04:38:51 +0000 (23:38 -0500)
src/hb-array.hh
src/hb-machinery.hh

index 0e99b07..83211aa 100644 (file)
@@ -222,4 +222,37 @@ inline hb_sorted_array_t<T> hb_sorted_array (T *array, unsigned int len)
 typedef hb_array_t<const char> hb_bytes_t;
 
 
+/*
+ * Supplier
+ */
+
+template <typename Type>
+struct Supplier : hb_array_t<const Type>
+{
+  Supplier (const Type *array, unsigned int len_)
+  {
+    this->arrayZ = array;
+    this->len = len_;
+  }
+  Supplier (hb_array_t<const Type> v)
+  {
+    this->arrayZ = v.arrayZ;
+    this->len = v.len;
+  }
+
+  Supplier<Type> & operator += (unsigned int count)
+  {
+    if (unlikely (count > this->len))
+      count = this->len;
+    this->len -= count;
+    this->arrayZ += count;
+    return *this;
+  }
+
+  private:
+  Supplier (const Supplier<Type> &); /* Disallow copy */
+  Supplier<Type>& operator= (const Supplier<Type> &); /* Disallow copy */
+};
+
+
 #endif /* HB_ARRAY_HH */
index 94eabeb..82144db 100644 (file)
@@ -637,38 +637,6 @@ struct hb_serialize_context_t
 };
 
 
-/*
- * Supplier
- */
-
-template <typename Type>
-struct Supplier : hb_array_t<const Type>
-{
-  Supplier (const Type *array, unsigned int len_)
-  {
-    this->arrayZ = array;
-    this->len = len_;
-  }
-  Supplier (hb_array_t<const Type> v)
-  {
-    this->arrayZ = v.arrayZ;
-    this->len = v.len;
-  }
-
-  Supplier<Type> & operator += (unsigned int count)
-  {
-    if (unlikely (count > this->len))
-      count = this->len;
-    this->len -= count;
-    this->arrayZ += count;
-    return *this;
-  }
-
-  private:
-  Supplier (const Supplier<Type> &); /* Disallow copy */
-  Supplier<Type>& operator= (const Supplier<Type> &); /* Disallow copy */
-};
-
 
 /*
  * Big-endian integers.