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

Class StructNested

projects/Python/proto/test.py:7373–7558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7371
7372@functools.total_ordering
7373class StructNested(StructOptional):
7374 __slots__ = "f1000", "f1001", "f1002", "f1003", "f1004", "f1005", "f1006", "f1007", "f1008", "f1009", "f1010", "f1011",
7375
7376 def __init__(self, parent=None, f1000=None, f1001=None, f1002=EnumTyped.ENUM_VALUE_2, f1003=None, f1004=None, f1005=None, f1006=FlagsTyped.FLAG_VALUE_2 | FlagsTyped.FLAG_VALUE_4 | FlagsTyped.FLAG_VALUE_6, f1007=None, f1008=None, f1009=None, f1010=None, f1011=None):
7377 super().__init__()
7378 if parent is None:
7379 parent = StructOptional()
7380 super().copy(parent)
7381 if f1000 is None:
7382 f1000 = EnumSimple()
7383 if f1004 is None:
7384 f1004 = FlagsSimple()
7385 if f1008 is None:
7386 f1008 = StructSimple()
7387 if f1010 is None:
7388 f1010 = StructOptional()
7389 self.f1000 = f1000
7390 self.f1001 = f1001
7391 self.f1002 = f1002
7392 self.f1003 = f1003
7393 self.f1004 = f1004
7394 self.f1005 = f1005
7395 self.f1006 = f1006
7396 self.f1007 = f1007
7397 self.f1008 = f1008
7398 self.f1009 = f1009
7399 self.f1010 = f1010
7400 self.f1011 = f1011
7401
7402 # Struct shallow copy
7403 def copy(self, other):
7404 super().copy(other)
7405 self.f1000 = other.f1000
7406 self.f1001 = other.f1001
7407 self.f1002 = other.f1002
7408 self.f1003 = other.f1003
7409 self.f1004 = other.f1004
7410 self.f1005 = other.f1005
7411 self.f1006 = other.f1006
7412 self.f1007 = other.f1007
7413 self.f1008 = other.f1008
7414 self.f1009 = other.f1009
7415 self.f1010 = other.f1010
7416 self.f1011 = other.f1011
7417 return self
7418
7419 # Struct deep clone
7420 def clone(self):
7421 # Serialize the struct to the FBE stream
7422 writer = StructNestedModel(fbe.WriteBuffer())
7423 writer.serialize(self)
7424
7425 # Deserialize the struct from the FBE stream
7426 reader = StructNestedModel(fbe.ReadBuffer())
7427 reader.attach_buffer(writer.buffer)
7428 return reader.deserialize()[0]
7429
7430 def __eq__(self, other):

Callers 5

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

Calls

no outgoing calls

Tested by 5

__from_json__Method · 0.56
getMethod · 0.56
deserializeMethod · 0.56
getMethod · 0.56
deserializeMethod · 0.56