//!;;Rpy::+
//!;;Rpy::Model Element : RexIExternalChannel
//!;;Rpy::
//!;;Rpy::Component : RunTest
//!;;Rpy::Configuration : HOST
//!;;Rpy::Project : Rex
//!;;Rpy::Generated Date : Tue, 19, Sep 2017
//!;;Rpy::
//!;;Rpy::File Path : RexIExternalChannel.h
//!;;Rpy::Tag : $Tag
//!;;Rpy::
//!;;Rpy::Copyright : Selex ES - COMPANY CONFIDENTIAL
//!;;Rpy::
//!;;Rpy::Generated by Rhapsody	: 7.5.3
//!;;Rpy::-
//
// @Brief: $FileBrief


#ifndef RexExternalChannelId_H
#define RexExternalChannelId_H

//## package Rex::RexPackages::RexNetPkg

//## class RexExternalChannelId
class RexExternalChannelId
{
public :

    //#[ type id_t
    typedef unsigned long long id_t;
    //#]

    //#[ type name_t
    typedef char* name_t;
    //#]

    ////    Constructors and destructors    ////

    //## operation RexExternalChannelId(id_t,const char*)
    RexExternalChannelId(const id_t& id, const char* name);

private :

    //## operation RexExternalChannelId()
    RexExternalChannelId();

public :

    //## auto_generated
    ~RexExternalChannelId();

    ////    Operations    ////

    //## operation id() const
    id_t id() const;

    //## operation name() const
    const char* name() const;

    ////    Additional operations    ////

protected :

    //## auto_generated
    void setM_name(const char* p_m_name);

    ////    Attributes    ////

    const id_t m_id;		//## attribute m_id

    const char* m_name;		//## attribute m_name
};

#endif


#ifndef RexIExternalChannel_H
#define RexIExternalChannel_H

//## link itsRexBatchTag
//#include "RexBatchTag.h"
typedef unsigned long RexBatchTag;

//## dependency RexExternalChannelId
//#include "RexExternalChannelId.h"
//## dependency RexExternalChannelMessageDescriptor
class RexExternalChannelMessageDescriptor;

//## dependency RexIEternalChannelReceiver
class RexIEternalChannelReceiver;

//## package Rex::RexPackages::RexNetPkg

//## class RexIExternalChannel
class RexIExternalChannel
{
public :

    // Message time id for received message.
    // TODO: use RexbathTimetag
    //#[ type time_t
    typedef RexBatchTag time_t;
    //#]

    //#[ type raw_data_pointer_t
    typedef void* raw_data_pointer_t;
    //#]

    ////    Constructors and destructors    ////

protected :

    //## operation RexIExternalChannel()
    RexIExternalChannel();

    //## operation RexIExternalChannel(RexExternalChannelId)
    RexIExternalChannel(const RexExternalChannelId& id);

public :

    //## auto_generated
    virtual ~RexIExternalChannel();

    ////    Operations    ////

    //## operation attachReceiver(RexIEternalChannelReceiver)
    virtual void attachReceiver(RexIEternalChannelReceiver& receiver);

    //## operation id() const
    const RexExternalChannelId& id() const;

    //## operation releaseMessage(RexExternalChannelMessageDescriptor)
    virtual void releaseMessage(const RexExternalChannelMessageDescriptor& d);

    //## operation resend()
    virtual void resend();

    //## operation send(const void*,int)
    virtual void send(const void* tx_data, int tx_len_bytes) = 0;
    virtual void sendTo(int port, const void* tx_data, int tx_len_bytes) = 0;

protected :

    //## operation dispatch(const void*,unsigned long,time_t)
    virtual void dispatch(const void* data, unsigned long size_bytes, const time_t& timetag);

    //## operation receive(void *,int)
    virtual void receive(void * rx_buffer, int max_len_bytes) = 0;

    ////    Additional operations    ////

public :

    //## auto_generated
    unsigned long getReceived() const;

    //## auto_generated
    int getUnserved() const;

    //## auto_generated
    unsigned long getRxPeriodMs() const;

    //## auto_generated
    unsigned long getMissed() const;

    //## auto_generated
    time_t getLastRxTime() const;

    //## auto_generated
    RexBatchTag* getItsRexBatchTag() const;

    ////    Attributes    ////

protected :

    unsigned long received;		//## attribute received

    int unserved;		//## attribute unserved

    unsigned long rxPeriodMs;		//## attribute rxPeriodMs

    unsigned long missed;		//## attribute missed

    const RexExternalChannelId chId;		//## attribute chId

    RexIEternalChannelReceiver* m_receiver;		//## attribute m_receiver

    time_t lastRxTime;		//## attribute lastRxTime

    const void* tx_stored_buffer;		//## attribute tx_stored_buffer

    unsigned long tx_stored_len;		//## attribute tx_stored_len

    ////    Relations and components    ////

    RexBatchTag itsRexBatchTag;		//## link itsRexBatchTag
};

#endif
//;;Rpy:: end
