MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / OrderMessage

Class OrderMessage

projects/Python/proto/protoex.py:2523–2604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2521
2522@functools.total_ordering
2523class OrderMessage(object):
2524 __slots__ = "body",
2525
2526 def __init__(self, body=None):
2527 if body is None:
2528 body = Order()
2529 self.body = body
2530
2531 # Struct shallow copy
2532 def copy(self, other):
2533 self.body = other.body
2534 return self
2535
2536 # Struct deep clone
2537 def clone(self):
2538 # Serialize the struct to the FBE stream
2539 writer = OrderMessageModel(fbe.WriteBuffer())
2540 writer.serialize(self)
2541
2542 # Deserialize the struct from the FBE stream
2543 reader = OrderMessageModel(fbe.ReadBuffer())
2544 reader.attach_buffer(writer.buffer)
2545 return reader.deserialize()[0]
2546
2547 def __eq__(self, other):
2548 if not isinstance(self, other.__class__):
2549 return NotImplemented
2550 return True
2551
2552 def __lt__(self, other):
2553 if not isinstance(self, other.__class__):
2554 return NotImplemented
2555 return False
2556
2557 @property
2558 def __key__(self):
2559 return ()
2560
2561 def __hash__(self):
2562 return hash(self.__key__)
2563
2564 def __format__(self, format_spec):
2565 return self.__str__()
2566
2567 def __str__(self):
2568 sb = list()
2569 sb.append("OrderMessage(")
2570 sb.append("body=")
2571 sb.append(str(self.body))
2572 sb.append(")")
2573 return "".join(sb)
2574
2575 # Get struct JSON value
2576 def to_json(self):
2577 return json.dumps(self.__to_json__(), cls=fbe.JSONEncoder, separators=(',', ':'))
2578
2579 def __to_json__(self):
2580 result = dict()

Callers 7

__from_json__Method · 0.70
getMethod · 0.70
deserializeMethod · 0.70
getMethod · 0.70
deserializeMethod · 0.70
__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected