![]() |
botsense
3.2.0
RoadNarrows Client-Server Proxied Services Framework
|
Public Member Functions | |
| def | __init__ (self, size=bsCore.BSPROXY_MSG_BODY_MAX) |
| def | __del__ (self) |
| def | __getitem__ (self, i) |
| def | __getslice__ (self, i, j) |
| def | __iadd__ (self, y) |
| def | __imul__ (self, y) |
| def | __iter__ (self) |
| def | __len__ (self) |
| def | __str__ (self) |
| def | __setitem__ (self, i, y) |
| def | __setslice__ (self, i, j, y) |
| def | __sizeof__ (self) |
| def | avail (self) |
| def | copyFromSwigObj (self, n, i=0, j=0) |
| def | copyToSwigObj (self, n, i=0, j=0) |
| def | getSwigObj (self) |
| def | getBuffer (self) |
| def | sizeof (self) |
Static Public Member Functions | |
| def | Constructor (seq) |
| def | Clone (buf) |
| def | byte (val) |
| def | bytelist (seq) |
| def | bytec (val) |
| def | bytestring (seq) |
Public Attributes | |
| buf | |
| python byte string | |
BotSense Byte Buffer Class.
The ByteBuf class provides a wrapper around the byte_t* SWIG object.
The byte_t is typedef'ed in C as an unsigned char. Byte buffers are used
in packing and unpacking messages and in communication between the
client and server.
Note: There does not seem to be any way to advance the pointer of the
underlining byte_t* SWIG object, so a copy from/to a python byte
list (buffer) is required.
Definition at line 355 of file BotSenseTypes.py.
| def BotSense.BotSenseTypes.ByteBuf.__init__ | ( | self, | |
size = bsCore.BSPROXY_MSG_BODY_MAX |
|||
| ) |
Initialize byte buffer instance.
Parameters:
size - Number of bytes of the underlining fixed sized SWIG
object.
Definition at line 369 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.ByteBuf._size, and BotSense.BotSenseTypes.ByteBuf._swigObj.
| def BotSense.BotSenseTypes.ByteBuf.__del__ | ( | self | ) |
Delete byte buffer instance.
Definition at line 390 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.ByteBuf._swigObj.
| def BotSense.BotSenseTypes.ByteBuf.__getitem__ | ( | self, | |
| i | |||
| ) |
| def BotSense.BotSenseTypes.ByteBuf.__getslice__ | ( | self, | |
| i, | |||
| j | |||
| ) |
x.__getslice__(i, j) <==> x[i:j]
Definition at line 445 of file BotSenseTypes.py.
| def BotSense.BotSenseTypes.ByteBuf.__iadd__ | ( | self, | |
| y | |||
| ) |
| def BotSense.BotSenseTypes.ByteBuf.__imul__ | ( | self, | |
| y | |||
| ) |
| def BotSense.BotSenseTypes.ByteBuf.__iter__ | ( | self | ) |
| def BotSense.BotSenseTypes.ByteBuf.__len__ | ( | self | ) |
x.__len__() <==> len(x) Number of bytes used in buffer.
Definition at line 472 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.ByteBuf.buf.
| def BotSense.BotSenseTypes.ByteBuf.__setitem__ | ( | self, | |
| i, | |||
| y | |||
| ) |
x.__setitem__(i, y) <==> x[i]=y
Definition at line 487 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.ByteBuf.byte().
| def BotSense.BotSenseTypes.ByteBuf.__setslice__ | ( | self, | |
| i, | |||
| j, | |||
| y | |||
| ) |
x.__setslice__(i, j, y) <==> x[i:j]=y
Definition at line 495 of file BotSenseTypes.py.
| def BotSense.BotSenseTypes.ByteBuf.__sizeof__ | ( | self | ) |
x.__sizeof__() -- size of swig object byte buffer, in bytes.
Definition at line 503 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.ByteBuf._size.
Referenced by BotSense.BotSenseTypes.ByteBuf.sizeof().
| def BotSense.BotSenseTypes.ByteBuf.__str__ | ( | self | ) |
| def BotSense.BotSenseTypes.ByteBuf.avail | ( | self | ) |
Available bytes in fixed swig object buffer.
Definition at line 509 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.ByteBuf._size, and BotSense.BotSenseTypes.ByteBuf.buf.
|
static |
Static method to convert a value into a byte.
Parameters:
val - Value to convert. Value type can be an integer [0,255],
a string of length 1, or a list of length 1 of element
type of integer, string, list.
Return:
On success, returns converted byte value.
On failure, a BotSenseError exception is raised.
Definition at line 577 of file BotSenseTypes.py.
Referenced by BotSense.BotSenseTypes.ByteBuf.__setitem__().
|
static |
Static method to convert a value into a byte character string.
Parameters:
val - Value to convert. Value type can be an integer [0,255],
a string of length 1, or a list of length 1 of element
type of integer, string, list.
Return:
On success, returns converted byte value.
On failure, a BotSenseError exception is raised.
Definition at line 638 of file BotSenseTypes.py.
|
static |
Static method to convert a value sequence into a byte list.
Parameters:
seq - Sequence of values to convert. Sequence type can be an
integer [0,255], a string, or a list of elements of
type integer, string, list.
Return:
On success, returns converted byte value list.
On failure, a BotSenseError exception is raised.
Definition at line 610 of file BotSenseTypes.py.
|
static |
Static method to convert a value sequence into a byte string.
Parameters:
seq - Sequence of values to convert. Sequence type can be an
integer [0,255], a string, or a list of elements of
type integer, string, list.
Return:
On success, returns converted byte value list.
On failure, a BotSenseError exception is raised.
Definition at line 671 of file BotSenseTypes.py.
|
static |
Smart clone constructor.
If buf is a ByteBuf instance, then simply return buf.
Otherwise convert buf to a ByteBuf instance.
The underlining swig object contents are not touched, so swig copies
will need to be done prior to or after calling a byte_t* core routine.
Parameters:
buf - Either a ByteBuf instance or a sequence of values to convert.
Sequence type can be an integer [0,255], a string, or a list
of elements of type integer, string, list.
Return:
Existing or new ByteBuf().
Definition at line 415 of file BotSenseTypes.py.
|
static |
Conversion constructor.
Parameters:
seq - Sequence of values to convert. Sequence type can be an
integer [0,255], a string, or a list of elements of
type integer, string, list.
Return:
New initialized ByteBuf().
Definition at line 397 of file BotSenseTypes.py.
| def BotSense.BotSenseTypes.ByteBuf.copyFromSwigObj | ( | self, | |
| n, | |||
i = 0, |
|||
j = 0 |
|||
| ) |
Copy swig object buffer to python buffer. Parameters: n - Number of bytes to copy. i - Starting source index in swig object buffer. j - Starting destination index in python buffer.
Definition at line 515 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.ByteBuf._size, BotSense.BotSenseTypes.ByteBuf._swigObj, and BotSense.BotSenseTypes.ByteBuf.buf.
| def BotSense.BotSenseTypes.ByteBuf.copyToSwigObj | ( | self, | |
| n, | |||
i = 0, |
|||
j = 0 |
|||
| ) |
Copy python buffer to instance swig object buffer. Parameters: n - Number of bytes to copy. i - Starting source index in python buffer. j - Starting destination index in swig object buffer.
Definition at line 537 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.ByteBuf._size, BotSense.BotSenseTypes.ByteBuf._swigObj, and BotSense.BotSenseTypes.ByteBuf.buf.
| def BotSense.BotSenseTypes.ByteBuf.getBuffer | ( | self | ) |
Return python buffer.
Definition at line 564 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.ByteBuf.buf.
| def BotSense.BotSenseTypes.ByteBuf.getSwigObj | ( | self | ) |
Return raw swig object.
Definition at line 558 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.ByteBuf._swigObj.
| def BotSense.BotSenseTypes.ByteBuf.sizeof | ( | self | ) |
Size of fixed swig object byte buffer, in bytes.
Definition at line 570 of file BotSenseTypes.py.
References BotSense.BotSenseTypes.BsClient.__sizeof__(), and BotSense.BotSenseTypes.ByteBuf.__sizeof__().