python: add size proprety

This commit is contained in:
Adrien Béraud committed 2016-05-19 17:28:31 -04:00
1 parent 18ec3086ee
commit 14cf0b3142
2 files changed
+4

No files matched your search

+3
View File
@@ -158,6 +158,9 @@ cdef class Value(object):
return self._value.get().id
def __set__(self, cpp.uint64_t value):
self._value.get().id = value
property size:
def __get__(self):
return self._value.get().size()
cdef class NodeSetIter(object):
cdef map[cpp.InfoHash, cpp.shared_ptr[cpp.Node]]* _nodes
+1
View File
@@ -85,6 +85,7 @@ cdef extern from "opendht/value.h" namespace "dht":
Value(vector[uint8_t]) except +
Value(const uint8_t* dat_ptr, size_t dat_len) except +
string toString() const
size_t size() const
uint64_t id
shared_ptr[PublicKey] owner
InfoHash recipient