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

Class StructMap

projects/Python/proto/test.py:12881–13162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12879
12880@functools.total_ordering
12881class StructMap(object):
12882 __slots__ = "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10",
12883
12884 def __init__(self, f1=None, f2=None, f3=None, f4=None, f5=None, f6=None, f7=None, f8=None, f9=None, f10=None):
12885 if f1 is None:
12886 f1 = dict()
12887 if f2 is None:
12888 f2 = dict()
12889 if f3 is None:
12890 f3 = dict()
12891 if f4 is None:
12892 f4 = dict()
12893 if f5 is None:
12894 f5 = dict()
12895 if f6 is None:
12896 f6 = dict()
12897 if f7 is None:
12898 f7 = dict()
12899 if f8 is None:
12900 f8 = dict()
12901 if f9 is None:
12902 f9 = dict()
12903 if f10 is None:
12904 f10 = dict()
12905 self.f1 = f1
12906 self.f2 = f2
12907 self.f3 = f3
12908 self.f4 = f4
12909 self.f5 = f5
12910 self.f6 = f6
12911 self.f7 = f7
12912 self.f8 = f8
12913 self.f9 = f9
12914 self.f10 = f10
12915
12916 # Struct shallow copy
12917 def copy(self, other):
12918 self.f1 = other.f1
12919 self.f2 = other.f2
12920 self.f3 = other.f3
12921 self.f4 = other.f4
12922 self.f5 = other.f5
12923 self.f6 = other.f6
12924 self.f7 = other.f7
12925 self.f8 = other.f8
12926 self.f9 = other.f9
12927 self.f10 = other.f10
12928 return self
12929
12930 # Struct deep clone
12931 def clone(self):
12932 # Serialize the struct to the FBE stream
12933 writer = StructMapModel(fbe.WriteBuffer())
12934 writer.serialize(self)
12935
12936 # Deserialize the struct from the FBE stream
12937 reader = StructMapModel(fbe.ReadBuffer())
12938 reader.attach_buffer(writer.buffer)

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