pymasep.common.object ===================== .. py:module:: pymasep.common.object Classes ------- .. autoapisummary:: pymasep.common.object.Object Module Contents --------------- .. py:class:: Object(environment, name = None, parent = None, xml_node = None, template=None, src_copy = None) Bases: :py:obj:`pymasep.common.base_object.BaseObject` Object inside the environment :param environment: an Environment instance :param name: name of the Object. :param xml_node: XML used to create the object. :param template: Template of the object. Needed if no xml_node. :param parent: Parent object (see objects hierarchy) :param src_copy: The Intention to copy. Needed if no xml_node or template. The copy is not made into the constructor. :raise pymasep.common.exception.CreationException: If no XML or no template or src_copy is present .. py:attribute:: __slots__ :value: ['object_state', 'containers'] .. py:attribute:: object_state :value: None the ObjectState of the object .. py:attribute:: containers all the containers of the object. .. py:method:: state() State of the Object. "Init" if the ObjectState or one of its containers is in init state. "Run" if the Object is operational. :return: The state of the Object .. py:method:: id_str() Create a string unique ID of the Object. Depends on the content of the base object and the id_str of all characteristics in object_state :return: The string unique ID .. py:method:: to_xml() Transform the Object to XML with ObjectState content See :ref:`serialization` for more information. :return: XML version of the ObjectState .. py:method:: from_xml(environment, xml_node) Transform an XML to an Object. The instance must be created before (with __init__(), passing the xml_node). See :ref:`serialization` for more information. :param environment: The environment where the Object is created. :param xml_node: The XML node that contains the object information. :raise pymasep.common.exception.CreationException: SubElement must be present if initializer is not present. At creation, Initializer must be present for all characteristics if initializer is not present for ObjectState .. py:method:: add_object_in_container(obj, container) Add an Object to a container. This method is currently not used, and some works need to be done to avoid the duplication of objects in state :param obj: The object to be added. :param container: The name of the container. .. py:method:: remove_object_from_container(obj) Remove an Object from its container. Warning: after this method, the object is not attached to anything. Should not be used at the moment. See MDV-72 .. py:method:: copy_obs(params) Deep copy the Object to a new instance. :param params: Not used in this method. Note : this method copy the reference of the parent. The parent should do the parent copy and assignment