#ifndef INCLUDE_LEARN_ATOMIPORT____LEARN____INTPORT_HPP_
#define INCLUDE_LEARN_ATOMIPORT____LEARN____INTPORT_HPP_

#include <AtomInternalPort.hpp>

#include <learn/PT__learn__intPort.hpp>
#include <learn/PV__learn__intPort.hpp>

class AtomIPort__learn__intPort : public AtomInternalPort {
public:
    AtomIPort__learn__intPort(const string &name);
    virtual ~AtomIPort__learn__intPort();

    PortValue &portValue() const;
    bool hasPortValue() const;
    void setPortValue(PortValue &portValue);
    void clearPortValue();

    bool isEnabled() const;
    void setIsEnabled(bool b);
    bool isDisabledByPriorities() const;
    void setIsDisabledByPriorities(bool b);

protected:
    PV__learn__intPort *mPortValue;

private:
    bool mIsEnabled;
    bool mIsDisabledByPriorities;
}; 

inline
PortValue &AtomIPort__learn__intPort::portValue() const {
    return *mPortValue;
}

inline
bool AtomIPort__learn__intPort::hasPortValue() const {
    return mPortValue != NULL;
}

inline
void AtomIPort__learn__intPort::setPortValue(PortValue &portValue) {
    assert(dynamic_cast<PV__learn__intPort *>(&portValue) != NULL);
    mPortValue = static_cast<PV__learn__intPort *> (&portValue);
}
inline
void AtomIPort__learn__intPort::clearPortValue() {
    mPortValue = NULL;
}

inline
bool AtomIPort__learn__intPort::isEnabled() const {
    return mIsEnabled;
}

inline
void AtomIPort__learn__intPort::setIsEnabled(bool b) {
    mIsEnabled = b;
}

inline
bool AtomIPort__learn__intPort::isDisabledByPriorities() const {
    return mIsDisabledByPriorities;
}

inline
void AtomIPort__learn__intPort::setIsDisabledByPriorities(bool b) {
    mIsDisabledByPriorities = b;
}

#endif // INCLUDE_LEARN_ATOMIPORT____LEARN____INTPORT_HPP_
