File: counter.pxd

package info (click to toggle)
python-preshed 4.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 224 kB
  • sloc: python: 367; ansic: 160; sh: 13; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 427 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from libc.stdint cimport int64_t
from libcpp.memory cimport unique_ptr

from cymem.cymem cimport Pool

from .maps cimport MapStruct
from .maps cimport map_init, map_get, map_set, map_iter
from .maps cimport key_t


ctypedef int64_t count_t


cdef class PreshCounter:
    cdef unique_ptr[MapStruct] c_map
    cdef public object smoother
    cdef readonly count_t total

    cpdef int inc(self, key_t key, count_t inc) except -1