| 10113 | |
| 10114 | @functools.total_ordering |
| 10115 | class StructVector(object): |
| 10116 | __slots__ = "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", |
| 10117 | |
| 10118 | def __init__(self, f1=None, f2=None, f3=None, f4=None, f5=None, f6=None, f7=None, f8=None, f9=None, f10=None): |
| 10119 | if f1 is None: |
| 10120 | f1 = list() |
| 10121 | if f2 is None: |
| 10122 | f2 = list() |
| 10123 | if f3 is None: |
| 10124 | f3 = list() |
| 10125 | if f4 is None: |
| 10126 | f4 = list() |
| 10127 | if f5 is None: |
| 10128 | f5 = list() |
| 10129 | if f6 is None: |
| 10130 | f6 = list() |
| 10131 | if f7 is None: |
| 10132 | f7 = list() |
| 10133 | if f8 is None: |
| 10134 | f8 = list() |
| 10135 | if f9 is None: |
| 10136 | f9 = list() |
| 10137 | if f10 is None: |
| 10138 | f10 = list() |
| 10139 | self.f1 = f1 |
| 10140 | self.f2 = f2 |
| 10141 | self.f3 = f3 |
| 10142 | self.f4 = f4 |
| 10143 | self.f5 = f5 |
| 10144 | self.f6 = f6 |
| 10145 | self.f7 = f7 |
| 10146 | self.f8 = f8 |
| 10147 | self.f9 = f9 |
| 10148 | self.f10 = f10 |
| 10149 | |
| 10150 | # Struct shallow copy |
| 10151 | def copy(self, other): |
| 10152 | self.f1 = other.f1 |
| 10153 | self.f2 = other.f2 |
| 10154 | self.f3 = other.f3 |
| 10155 | self.f4 = other.f4 |
| 10156 | self.f5 = other.f5 |
| 10157 | self.f6 = other.f6 |
| 10158 | self.f7 = other.f7 |
| 10159 | self.f8 = other.f8 |
| 10160 | self.f9 = other.f9 |
| 10161 | self.f10 = other.f10 |
| 10162 | return self |
| 10163 | |
| 10164 | # Struct deep clone |
| 10165 | def clone(self): |
| 10166 | # Serialize the struct to the FBE stream |
| 10167 | writer = StructVectorModel(fbe.WriteBuffer()) |
| 10168 | writer.serialize(self) |
| 10169 | |
| 10170 | # Deserialize the struct from the FBE stream |
| 10171 | reader = StructVectorModel(fbe.ReadBuffer()) |
| 10172 | reader.attach_buffer(writer.buffer) |
no outgoing calls