summaryrefslogtreecommitdiff
path: root/src/nslcd_proto/enumerator@T.got
diff options
context:
space:
mode:
Diffstat (limited to 'src/nslcd_proto/enumerator@T.got')
-rw-r--r--src/nslcd_proto/enumerator@T.got26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/nslcd_proto/enumerator@T.got b/src/nslcd_proto/enumerator@T.got
new file mode 100644
index 0000000..88c3603
--- /dev/null
+++ b/src/nslcd_proto/enumerator@T.got
@@ -0,0 +1,26 @@
+// -*- Mode: Go -*-
+package nslcd_proto
+
+type <T>_Enumerator interface {
+ GetNext() (n <T>, err error)
+ GenericGetNext() (n interface{}, err error)
+}
+
+type <T>_List struct {
+ dat []<T>
+ i int
+}
+
+func New_<T>_List(ary []<T>) *<T>_List {
+ return &<T>_List{ary, 0}
+}
+
+func (o *<T>_List) GetNext() (n <T>, err error) {
+ n = o.dat[o.i]
+ err = nil
+ o.i++
+ return
+}
+func (o *<T>_List) GenericGetNext() (n interface{}, err error) {
+ return o.GetNext()
+}