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