INET Framework for OMNeT++/OMNEST
inet::ClockEvent_Base Class Reference

Class generated from inet/clock/common/ClockEvent.msg:21 by opp_msgtool. More...

#include <ClockEvent_m.h>

Inheritance diagram for inet::ClockEvent_Base:
inet::ClockEvent inet::GptpReqAnswerEvent

Public Member Functions

virtual ~ClockEvent_Base ()
 
virtual ClockEvent_Basedup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual const IClockgetClock () const
 
virtual IClockgetClockForUpdate ()
 
virtual void setClock (IClock *clock)
 
virtual bool getRelative () const
 
virtual void setRelative (bool relative)
 
virtual clocktime_t getArrivalClockTime () const
 
virtual void setArrivalClockTime (clocktime_t arrivalClockTime)
 
virtual OverdueClockEventHandlingMode getOverdueClockEventHandlingMode () const
 
virtual void setOverdueClockEventHandlingMode (OverdueClockEventHandlingMode overdueClockEventHandlingMode)
 

Protected Member Functions

bool operator== (const ClockEvent_Base &)=delete
 
 ClockEvent_Base (const char *name=nullptr, short kind=0)
 
 ClockEvent_Base (const ClockEvent_Base &other)
 
ClockEvent_Baseoperator= (const ClockEvent_Base &other)
 

Protected Attributes

IClockclock = nullptr
 
bool relative = false
 
clocktime_t arrivalClockTime = -1
 
OverdueClockEventHandlingMode overdueClockEventHandlingMode = UNSPECIFIED
 

Private Member Functions

void copy (const ClockEvent_Base &other)
 

Detailed Description

Class generated from inet/clock/common/ClockEvent.msg:21 by opp_msgtool.

message ClockEvent
{
    @customize;
    IClock *clock;
    bool relative = false;
    clocktime_t arrivalClockTime = -1;
    OverdueClockEventHandlingMode overdueClockEventHandlingMode = UNSPECIFIED;
}

ClockEvent_Base is only useful if it gets subclassed, and ClockEvent is derived from it. The minimum code to be written for ClockEvent is the following:

class INET_API ClockEvent : public ClockEvent_Base
{
  private:
    void copy(const ClockEvent& other) { ... }
  public:
    ClockEvent(const char *name=nullptr, short kind=0) : ClockEvent_Base(name,kind) {}
    ClockEvent(const ClockEvent& other) : ClockEvent_Base(other) {copy(other);}
    ClockEvent& operator=(const ClockEvent& other) {if (this==&other) return *this; ClockEvent_Base::operator=(other); copy(other); return *this;}
    virtual ClockEvent *dup() const override {return new ClockEvent(*this);}
    // ADD CODE HERE to redefine and implement pure virtual functions from ClockEvent_Base
};

The following should go into a .cc (.cpp) file:

Register_Class(ClockEvent)

Constructor & Destructor Documentation

◆ ClockEvent_Base() [1/2]

inet::ClockEvent_Base::ClockEvent_Base ( const char *  name = nullptr,
short  kind = 0 
)
protected

◆ ClockEvent_Base() [2/2]

inet::ClockEvent_Base::ClockEvent_Base ( const ClockEvent_Base other)
protected

◆ ~ClockEvent_Base()

virtual inet::ClockEvent_Base::~ClockEvent_Base ( )
virtual

Member Function Documentation

◆ copy()

void inet::ClockEvent_Base::copy ( const ClockEvent_Base other)
private

◆ dup()

virtual ClockEvent_Base* inet::ClockEvent_Base::dup ( ) const
inlineoverridevirtual

Reimplemented in inet::GptpReqAnswerEvent, and inet::ClockEvent.

126 {throw omnetpp::cRuntimeError("You forgot to manually add a dup() function to class ClockEvent");}

◆ getArrivalClockTime()

virtual clocktime_t inet::ClockEvent_Base::getArrivalClockTime ( ) const
virtual

◆ getClock()

virtual const IClock* inet::ClockEvent_Base::getClock ( ) const
virtual

◆ getClockForUpdate()

virtual IClock* inet::ClockEvent_Base::getClockForUpdate ( )
inlinevirtual
131 { return const_cast<IClock *>(const_cast<ClockEvent_Base*>(this)->getClock());}

◆ getOverdueClockEventHandlingMode()

virtual OverdueClockEventHandlingMode inet::ClockEvent_Base::getOverdueClockEventHandlingMode ( ) const
virtual

◆ getRelative()

virtual bool inet::ClockEvent_Base::getRelative ( ) const
virtual

◆ operator=()

ClockEvent_Base& inet::ClockEvent_Base::operator= ( const ClockEvent_Base other)
protected

◆ operator==()

bool inet::ClockEvent_Base::operator== ( const ClockEvent_Base )
protecteddelete

◆ parsimPack()

virtual void inet::ClockEvent_Base::parsimPack ( omnetpp::cCommBuffer *  b) const
overridevirtual

Reimplemented in inet::GptpReqAnswerEvent.

◆ parsimUnpack()

virtual void inet::ClockEvent_Base::parsimUnpack ( omnetpp::cCommBuffer *  b)
overridevirtual

Reimplemented in inet::GptpReqAnswerEvent.

◆ setArrivalClockTime()

virtual void inet::ClockEvent_Base::setArrivalClockTime ( clocktime_t  arrivalClockTime)
virtual

◆ setClock()

◆ setOverdueClockEventHandlingMode()

virtual void inet::ClockEvent_Base::setOverdueClockEventHandlingMode ( OverdueClockEventHandlingMode  overdueClockEventHandlingMode)
virtual

◆ setRelative()

virtual void inet::ClockEvent_Base::setRelative ( bool  relative)
virtual

Member Data Documentation

◆ arrivalClockTime

clocktime_t inet::ClockEvent_Base::arrivalClockTime = -1
protected

Referenced by inet::Register_Class().

◆ clock

IClock* inet::ClockEvent_Base::clock = nullptr
protected

Referenced by inet::Register_Class().

◆ overdueClockEventHandlingMode

OverdueClockEventHandlingMode inet::ClockEvent_Base::overdueClockEventHandlingMode = UNSPECIFIED
protected

◆ relative

bool inet::ClockEvent_Base::relative = false
protected

The documentation for this class was generated from the following file:
inet::ClockEvent_Base::getClock
virtual const IClock * getClock() const
inet::ClockEvent_Base::ClockEvent_Base
ClockEvent_Base(const char *name=nullptr, short kind=0)