#ifndef PRIORITIES__XIN__XATOM_AT____PRIORITIES__XIN__XATOM____MYATOM_HPP_
#define PRIORITIES__XIN__XATOM_AT____PRIORITIES__XIN__XATOM____MYATOM_HPP_

// /opt/bip_fmu/examples/simple/priorities_in_atom.bip:5:2
// include package "master" header
#include <priorities_xin_xatom.hpp>

#include <Atom.hpp>


#include <priorities_xin_xatom/AtomIPort__priorities_xin_xatom__Port.hpp>



#include <priorities_xin_xatom/PV__priorities_xin_xatom__Port.hpp>



class AT__priorities_xin_xatom__MyAtom : public Atom {
private:
   // internal ports & associated port values
    AtomIPort__priorities_xin_xatom__Port &_iport_decl__p;
    PV__priorities_xin_xatom__Port _iport_decl_pv__p;
    AtomIPort__priorities_xin_xatom__Port &_iport_decl__q;
    PV__priorities_xin_xatom__Port _iport_decl_pv__q;
public:
    AT__priorities_xin_xatom__MyAtom(const string &name , AtomIPort__priorities_xin_xatom__Port &_iport_decl__p, AtomIPort__priorities_xin_xatom__Port &_iport_decl__q
                             
                             
                             
                             );
    virtual ~AT__priorities_xin_xatom__MyAtom();

    virtual BipError& execute(PortValue &portValue);
    virtual BipError& execute(AtomExternalPort &portValue);
    virtual BipError& initialize();
    virtual string toString() const;

protected:
    BipError& update();

    BipError& executeInternalTransitions();
    BipError& checkInvariants();

    const static size_t bvector_size = 1/(8*sizeof(int))+((1%(8*sizeof(int))) > 0 ? 1 : 0);
    int __statesbv[ bvector_size ];

    // component data declarations
    int _id__i;

    // enabledness of transitions
    bool _transguard__1;
    bool _transguard__2;

    // guards of priorities
    bool _prioguard__myPrioEven;
    bool _prioguard__myPrioOdd;

    // enabledness of priorities
    bool _prioenabled__myPrioEven;
    bool _prioenabled__myPrioOdd;

    // enabledness of priority paths
    bool _priopathenabled__1__2;
    bool _priopathenabled__1;

    bool _priopathenabled__2__1;
    bool _priopathenabled__2;

    // index of the latest executed transition
    int __previous;

    bool atLOOP() const;
    bool toLOOP();
    bool fromLOOP();
};

#endif // PRIORITIES__XIN__XATOM_AT____PRIORITIES__XIN__XATOM____MYATOM_HPP_
