/* SPDX-License-Identifier: BSD-3-Clause */
/*
 * Copyright 2012 Raritan Inc. All rights reserved.
 */

#ifndef __PDUMODEL_EDEVICE_IDL__
#define __PDUMODEL_EDEVICE_IDL__

#include <Pole.idl>
#include <Waveform.idl>

/** PDU Model */
module pdumodel {

    /**
     * Common base interface for any kind of electrical device that is used
     * in the PDU model, such as inlets, OCPs and outlets.
     *
     * EDevices form a hierarchy of parent-child relationships. An EDevice is
     * defined to be the parent of another if it "provides energy" to the
     * latter. E.g. an inlet could be the parent of a number of OCPs,
     * wires or outlets.
     *
     * An EDevice can have multiple parents, e.g. in case of transfer switches
     * which select power from multiple sources.
     */
    interface EDevice_1_0_1 {
        /**
         * Get the list of devices that provide energy to this device.
         *
         * @return List of parent devices
         */
        vector<EDevice_1_0_1> getParents();

        /**
         * Get the list of devices that are directly fed by this device.
         *
         * @return List of child devices
         */
        vector<EDevice_1_0_1> getChildren();

        /**
         * Get the current voltage and current waveforms for this device.
         *
         * @note If waveform reading is not supported, an empty waveform is returned.
         *
         * @return Waveform samples
         */
        Waveform getWaveform();

        /**
         * Get the current voltage and current waveforms for a pole of this device.
         *
         * @note If waveform reading is not supported, an empty waveform is returned.
         *
         * @return Waveform samples
         */
        Waveform getPoleWaveform(in PowerLine_3_0_0 line);
    };

}

#endif
