Exemplo n.º 1
0
 def __init__(self, name):
     try:
         name = name.encode('utf-8')
     except AttributeError:
         # Python2 catch
         pass
     BifrostObject.__init__(self, _bf.bfProcLogCreate, _bf.bfProcLogDestroy,
                            name)
Exemplo n.º 2
0
 def __init__(self, fmt, sock, ring, nsrc, src0, max_payload_size,
              buffer_ntime, slot_ntime, sequence_callback, core=None):
     if core is None:
         core = -1
     BifrostObject.__init__(
         self, _bf.bfUdpCaptureCreate, _bf.bfUdpCaptureDestroy,
         fmt, sock.fileno(), ring.obj, nsrc, src0,
         max_payload_size, buffer_ntime, slot_ntime,
         sequence_callback, core)
Exemplo n.º 3
0
 def __init__(self, address, port, family=None):
     try:
         address = address.encode()
     except AttributeError:
         # Python2 catch
         pass
     assert (isinstance(port, (int, long)))
     if family is None:
         family = AF_UNSPEC
     BifrostObject.__init__(self, _bf.bfAddressCreate, _bf.bfAddressDestroy,
                            address, port, family)
Exemplo n.º 4
0
 def __init__(self, space='system', name=None, core=None):
     if name is None:
         name = str(uuid4())
     name = _slugify(name)
     try:
         name = name.encode()
     except AttributeError:
         # Python2 catch
         pass
     space = _string2space(space)
     #self.obj = None
     #self.obj = _get(_bf.bfRingCreate(name=name, space=space), retarg=0)
     BifrostObject.__init__(self, _bf.bfRingCreate, _bf.bfRingDestroy, name,
                            space)
     if core is not None:
         try:
             _check(_bf.bfRingSetAffinity(self.obj, core))
         except RuntimeError:
             pass
Exemplo n.º 5
0
 def __init__(self, space='system', name=None, owner=None, core=None):
     # If this is non-None, then the object is wrapping a base Ring instance
     self.base = None
     self.space = space
     if name is None:
         name = 'ring_%i' % Ring.instance_count
         Ring.instance_count += 1
     name = _slugify(name)
     try:
         name = name.encode()
     except AttributeError:
         # Python2 catch
         pass
     BifrostObject.__init__(self, _bf.bfRingCreate, _bf.bfRingDestroy, name,
                            _string2space(self.space))
     if core is not None:
         try:
             _check(_bf.bfRingSetAffinity(self.obj, core))
         except RuntimeError:
             pass
     self.owner = owner
     self.header_transform = None
Exemplo n.º 6
0
 def __init__(self):
     BifrostObject.__init__(self, _bf.bfLinAlgCreate, _bf.bfLinAlgDestroy)
Exemplo n.º 7
0
 def __init__(self):
     BifrostObject.__init__(self, _bf.bfFirCreate, _bf.bfFirDestroy)
Exemplo n.º 8
0
 def __init__(self, sock, core=-1):
     BifrostObject.__init__(
         self, _bf.bfUdpTransmitCreate, _bf.bfUdpTransmitDestroy,
         sock.fileno(), core)
Exemplo n.º 9
0
 def __init__(self):
     BifrostObject.__init__(self, _bf.bfRomeinCreate, _bf.bfRomeinDestroy)
Exemplo n.º 10
0
 def __init__(self):
     BifrostObject.__init__(self, _bf.bfUdpSocketCreate,
                            _bf.bfUdpSocketDestroy)
Exemplo n.º 11
0
 def __del__(self):
     if self.base is not None and not self.is_view:
         BifrostObject.__del__(self)
Exemplo n.º 12
0
 def __del__(self):
     if self.base is not None:
         BifrostObject.__del__(self)