MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / ExtensionObject

Class ExtensionObject

opcua/ua/uatypes.py:587–621  ·  view source on GitHub ↗

Any UA object packed as an ExtensionObject :ivar TypeId: :vartype TypeId: NodeId :ivar Body: :vartype Body: bytes

Source from the content-addressed store, hash-verified

585
586
587class ExtensionObject(FrozenClass):
588 """
589 Any UA object packed as an ExtensionObject
590
591 :ivar TypeId:
592 :vartype TypeId: NodeId
593 :ivar Body:
594 :vartype Body: bytes
595 """
596 ua_switches = {
597 'Body': ('Encoding', 0),
598 }
599
600 ua_types = (
601 ("TypeId", "NodeId"),
602 ("Encoding", "Byte"),
603 ("Body", "ByteString"),
604 )
605
606 def __init__(self):
607 self.TypeId = NodeId()
608 self.Encoding = 0
609 self.Body = None
610 self._freeze = True
611
612 def __bool__(self):
613 return self.Body is not None
614 __nonzero__ = __bool__ # Python2 compatibilty
615
616 def __str__(self):
617 size = len(self.Body) if self.Body is not None else None
618 return 'ExtensionObject(' + 'TypeId:' + str(self.TypeId) + ', ' + \
619 'Encoding:' + str(self.Encoding) + ', ' + str(size) + ' bytes)'
620
621 __repr__ = __str__
622
623
624class VariantType(Enum):

Callers 15

get_default_valueFunction · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected