Interface PVCopy


  • public interface PVCopy
    Author:
    mrk This interface maps between a master PVStructure and a PVStructure that holds a copy of a subset of the data in the master.
    • Method Detail

      • getPVMaster

        PVStructure getPVMaster()
        Get the master PVStructure to which this PVCopy is attached.
        Returns:
        The interface.
      • traverseMaster

        void traverseMaster​(PVCopyTraverseMasterCallback callback)
        Traverse all the fields in master.
        Parameters:
        callback - This is called for each field on master.
      • getStructure

        Structure getStructure()
        Get the introspection interface for the set of fields describing the subset of the fields from PVRecord which a PVStructure contains.
        Returns:
        The introspection interface.
      • createPVStructure

        PVStructure createPVStructure()
        Create a PVStructure which can hold a subset of the data from the master. A client may require multiple PVStructures. For example if a monitor request supports a queue than a PVStructure is required for each queue element.
        Returns:
        The interface.
      • getCopyOffset

        int getCopyOffset​(PVField masterPVField)
        Given a field the master. return the offset in copy for the same field. A value of -1 that the copy does not have this field.
        Parameters:
        masterPVField - The field in master.
        Returns:
        The offset or -1 if the field in the record does not have a copy in the PVStructure.
      • getCopyOffset

        int getCopyOffset​(PVStructure masterPVStructure,
                          PVField masterPVField)
        Given a field within master, return the offset in copy for the same field. A value of -1 that the copy does not have this field.
        Parameters:
        masterPVStructure - A structure in master that has masterPVField.
        masterPVField - The field in master.
        Returns:
        The offset or -1 if the field in the record does not have a copy in the PVStructure.
      • getMasterPVField

        PVField getMasterPVField​(int structureOffset)
        Given a offset in the copy get the corresponding field in master.
        Parameters:
        structureOffset - The offset in the copy.
        Returns:
        The interface within master.
      • initCopy

        void initCopy​(PVStructure copyPVStructure,
                      BitSet bitSet)
        Initialize PVStructure with the current data from the PVRecord. The bitSet will have offset 0 set to 1 and all other bits set to 0.
        Parameters:
        copyPVStructure - The PVStructure.
        bitSet - The bitSet for PVStructure.
      • updateCopySetBitSet

        void updateCopySetBitSet​(PVStructure copyPVStructure,
                                 BitSet bitSet)
        Update PVStructure from master. The BitSet shows which fields in PVStructure have changed.
        Parameters:
        copyPVStructure - The PVStructure.
        bitSet - The BitSet which shows the fields that were modified.
      • updateCopyFromBitSet

        void updateCopyFromBitSet​(PVStructure copyPVStructure,
                                  BitSet bitSet)
        Update PVStructure from the bitSet. Thus each PVField of PVStructure for which bitSet.get(pvField.getOffset) is true is updated with the data from the PVRecord.
        Parameters:
        copyPVStructure - The PVStructure.
        bitSet - The bitSet which shows which fields should be updated.
      • updateMaster

        void updateMaster​(PVStructure copyPVStructure,
                          BitSet bitSet)
        Update the fields in master with data from PVStructure. Only fields that have the offset in bitSet set to true are modified.
        Parameters:
        copyPVStructure - The PVStructure.
        bitSet - The offsets within PVStructure that have new data.
      • getOptions

        PVStructure getOptions​(int fieldOffset)
        Get options for a field in a PVStructure created by pvCopy
        Parameters:
        fieldOffset - The field offset.
        Returns:
        The pvStructure containing the options or null if the field did not have options.
      • dump

        String dump()
        Dump the internal pvCopy nodes.
        Returns:
        The nodes.