#ifndef INCLUDE_PRIORITIES__XIN__XATOM_ATOMEPORT____PRIORITIES__XIN__XATOM____PORT_HPP_
#define INCLUDE_PRIORITIES__XIN__XATOM_ATOMEPORT____PRIORITIES__XIN__XATOM____PORT_HPP_

#include <AtomExportPort.hpp>
#include <priorities_xin_xatom/AtomIPort__priorities_xin_xatom__Port.hpp>

#include <priorities_xin_xatom/PT__priorities_xin_xatom__Port.hpp>

class AtomEPort__priorities_xin_xatom__Port :
    public virtual Port,
    public AtomExportPort,
    public PT__priorities_xin_xatom__Port {
public:
    AtomEPort__priorities_xin_xatom__Port(const string &name, bool hasEarlyUpdate);
    virtual ~AtomEPort__priorities_xin_xatom__Port();
    virtual void addInternalPort(AtomIPort__priorities_xin_xatom__Port &p);

    virtual vector<PortValue *> &portValues();
    virtual const vector<PortValue *> &portValues() const;
    virtual bool hasPortValues() const;
    virtual void addPortValue(PortValue &port);
    virtual void clearPortValues();

    virtual bool isReset() const;
    void setIsReset(bool b);

protected:
// Getting messy to store actual type and return more abstract one (thanks to vector template...)
//    vector<PV__priorities_xin_xatom__Port *> mPortValues;
    vector<PortValue *> mPortValues;
    bool mIsReset;
}; 


inline
void AtomEPort__priorities_xin_xatom__Port::addInternalPort(AtomIPort__priorities_xin_xatom__Port &p) {
    AtomExportPort::addInternalPort(p);
}

inline
vector<PortValue *> &AtomEPort__priorities_xin_xatom__Port::portValues() {
    return mPortValues;
}

inline
const vector<PortValue *> &AtomEPort__priorities_xin_xatom__Port::portValues() const {
    return mPortValues;
}

inline
bool AtomEPort__priorities_xin_xatom__Port::hasPortValues() const {
    return !mPortValues.empty();
}

inline
void AtomEPort__priorities_xin_xatom__Port::addPortValue(PortValue &port) {
    mPortValues.push_back(&port);
}

inline
void AtomEPort__priorities_xin_xatom__Port::clearPortValues() {
    mPortValues.clear();
}

inline
bool AtomEPort__priorities_xin_xatom__Port::isReset() const {
    return mIsReset;
}

inline
void AtomEPort__priorities_xin_xatom__Port::setIsReset(bool b) {
    mIsReset = b;
}
#endif // INCLUDE_PRIORITIES__XIN__XATOM_ATOMEPORT____PRIORITIES__XIN__XATOM____PORT_HPP_
