Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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
Esempio 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
Esempio n. 6
0
 def __init__(self):
     BifrostObject.__init__(self, _bf.bfLinAlgCreate, _bf.bfLinAlgDestroy)
Esempio n. 7
0
 def __init__(self):
     BifrostObject.__init__(self, _bf.bfFirCreate, _bf.bfFirDestroy)
Esempio n. 8
0
 def __init__(self, sock, core=-1):
     BifrostObject.__init__(
         self, _bf.bfUdpTransmitCreate, _bf.bfUdpTransmitDestroy,
         sock.fileno(), core)
Esempio n. 9
0
 def __init__(self):
     BifrostObject.__init__(self, _bf.bfRomeinCreate, _bf.bfRomeinDestroy)
Esempio n. 10
0
 def __init__(self):
     BifrostObject.__init__(self, _bf.bfUdpSocketCreate,
                            _bf.bfUdpSocketDestroy)
Esempio n. 11
0
 def __del__(self):
     if self.base is not None and not self.is_view:
         BifrostObject.__del__(self)
Esempio n. 12
0
 def __del__(self):
     if self.base is not None:
         BifrostObject.__del__(self)