INET Framework for OMNeT++/OMNEST
inet::physicallayer::ReferenceCommunicationCache Class Reference

#include <ReferenceCommunicationCache.h>

Inheritance diagram for inet::physicallayer::ReferenceCommunicationCache:
inet::physicallayer::CommunicationCacheBase inet::physicallayer::ICommunicationCache inet::physicallayer::IPrintableObject

Public Member Functions

 ReferenceCommunicationCache ()
 
virtual ~ReferenceCommunicationCache ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
Medium state change notifications
virtual void addRadio (const IRadio *radio) override
 
virtual void removeRadio (const IRadio *radio) override
 
virtual void addTransmission (const ITransmission *transmission) override
 
virtual void removeTransmission (const ITransmission *transmission) override
 
Interference cache
virtual void removeNonInterferingTransmissions () override
 
virtual std::vector< const ITransmission * > * computeInterferingTransmissions (const IRadio *radio, const simtime_t startTime, const simtime_t endTime) override
 
Reception cache
virtual const IReceptiongetCachedReception (const IRadio *radio, const ITransmission *transmission) override
 
virtual const IInterferencegetCachedInterference (const IRadio *receiver, const ITransmission *transmission) override
 
virtual const INoisegetCachedNoise (const IRadio *receiver, const ITransmission *transmission) override
 
virtual const ISNIRgetCachedSNIR (const IRadio *receiver, const ITransmission *transmission) override
 
virtual const IReceptionDecisiongetCachedReceptionDecision (const IRadio *radio, const ITransmission *transmission, IRadioSignal::SignalPart part) override
 
- Public Member Functions inherited from inet::physicallayer::CommunicationCacheBase
 CommunicationCacheBase ()
 
virtual ~CommunicationCacheBase ()
 
virtual const simtime_t getCachedInterferenceEndTime (const ITransmission *transmission) override
 
virtual void setCachedInterferenceEndTime (const ITransmission *transmission, const simtime_t interferenceEndTime) override
 
virtual void removeCachedInterferenceEndTime (const ITransmission *transmission) override
 
virtual const IRadioFramegetCachedFrame (const ITransmission *transmission) override
 
virtual void setCachedFrame (const ITransmission *transmission, const IRadioFrame *frame) override
 
virtual void removeCachedFrame (const ITransmission *transmission) override
 
virtual const IArrivalgetCachedArrival (const IRadio *receiver, const ITransmission *transmission) override
 
virtual void setCachedArrival (const IRadio *receiver, const ITransmission *transmission, const IArrival *arrival) override
 
virtual void removeCachedArrival (const IRadio *receiver, const ITransmission *transmission) override
 
virtual const IntervalgetCachedInterval (const IRadio *receiver, const ITransmission *transmission) override
 
virtual void setCachedInterval (const IRadio *receiver, const ITransmission *transmission, const Interval *interval) override
 
virtual void removeCachedInterval (const IRadio *receiver, const ITransmission *transmission) override
 
virtual const IListeninggetCachedListening (const IRadio *receiver, const ITransmission *transmission) override
 
virtual void setCachedListening (const IRadio *receiver, const ITransmission *transmission, const IListening *listening) override
 
virtual void removeCachedListening (const IRadio *receiver, const ITransmission *transmission) override
 
virtual void setCachedReception (const IRadio *receiver, const ITransmission *transmission, const IReception *reception) override
 
virtual void removeCachedReception (const IRadio *receiver, const ITransmission *transmission) override
 
virtual void setCachedInterference (const IRadio *receiver, const ITransmission *transmission, const IInterference *interference) override
 
virtual void removeCachedInterference (const IRadio *receiver, const ITransmission *transmission) override
 
virtual void setCachedNoise (const IRadio *receiver, const ITransmission *transmission, const INoise *noise) override
 
virtual void removeCachedNoise (const IRadio *receiver, const ITransmission *transmission) override
 
virtual void setCachedSNIR (const IRadio *receiver, const ITransmission *transmission, const ISNIR *snir) override
 
virtual void removeCachedSNIR (const IRadio *receiver, const ITransmission *transmission) override
 
virtual void setCachedReceptionDecision (const IRadio *receiver, const ITransmission *transmission, IRadioSignal::SignalPart part, const IReceptionDecision *receptionDecision) override
 
virtual void removeCachedReceptionDecision (const IRadio *receiver, const ITransmission *transmission, IRadioSignal::SignalPart part) override
 
virtual const IReceptionResultgetCachedReceptionResult (const IRadio *receiver, const ITransmission *transmission) override
 
virtual void setCachedReceptionResult (const IRadio *receiver, const ITransmission *transmission, const IReceptionResult *receptionResult) override
 
virtual void removeCachedReceptionResult (const IRadio *receiver, const ITransmission *transmission) override
 
virtual const IRadioFramegetCachedFrame (const IRadio *receiver, const ITransmission *transmission) override
 
virtual void setCachedFrame (const IRadio *receiver, const ITransmission *transmission, const IRadioFrame *frame) override
 
virtual void removeCachedFrame (const IRadio *receiver, const ITransmission *transmission) override
 
Medium state change notifications
Interference cache
Transmission cache
Reception Cache
- Public Member Functions inherited from inet::physicallayer::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string getInfoStringRepresentation () const
 
virtual std::string getDetailStringRepresentation () const
 
virtual std::string getDebugStringRepresentation () const
 
virtual std::string getTraceStringRepresentation () const
 
virtual std::string getCompleteStringRepresentation () const
 

Protected Member Functions

Cache data structures
virtual RadioCacheEntrygetRadioCacheEntry (const IRadio *radio) override
 
virtual TransmissionCacheEntrygetTransmissionCacheEntry (const ITransmission *transmission) override
 
virtual ReceptionCacheEntrygetReceptionCacheEntry (const IRadio *radio, const ITransmission *transmission) override
 
Cache data structures

Protected Attributes

std::vector< TransmissionCacheEntrytransmissionCache
 
std::vector< RadioCacheEntryradioCache
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 

Constructor & Destructor Documentation

inet::physicallayer::ReferenceCommunicationCache::ReferenceCommunicationCache ( )
28 {
29 }
inet::physicallayer::ReferenceCommunicationCache::~ReferenceCommunicationCache ( )
virtual
32 {
33 }

Member Function Documentation

void inet::physicallayer::ReferenceCommunicationCache::addRadio ( const IRadio radio)
overridevirtual

Implements inet::physicallayer::ICommunicationCache.

65 {
66  radioCache.push_back(RadioCacheEntry());
67 }
std::vector< RadioCacheEntry > radioCache
Definition: ReferenceCommunicationCache.h:31
void inet::physicallayer::ReferenceCommunicationCache::addTransmission ( const ITransmission transmission)
overridevirtual

Implements inet::physicallayer::ICommunicationCache.

74 {
75  transmissionCache.push_back(TransmissionCacheEntry());
76 }
std::vector< TransmissionCacheEntry > transmissionCache
Definition: ReferenceCommunicationCache.h:30
std::vector< const ITransmission * > * inet::physicallayer::ReferenceCommunicationCache::computeInterferingTransmissions ( const IRadio radio,
const simtime_t  startTime,
const simtime_t  endTime 
)
overridevirtual

Reimplemented from inet::physicallayer::CommunicationCacheBase.

87 {
88  std::vector<const ITransmission *> *interferingTransmissions = new std::vector<const ITransmission *>();
89  for (const auto &transmissionCacheEntry : transmissionCache) {
90  for (const auto &receptionCacheEntry : *static_cast<std::vector<ReceptionCacheEntry> *>(transmissionCacheEntry.receptionCacheEntries)) {
91  const IArrival *arrival = receptionCacheEntry.arrival;
92  if (arrival != nullptr && !(arrival->getEndTime() < startTime || endTime < arrival->getStartTime()))
93  interferingTransmissions->push_back(transmissionCacheEntry.frame->getTransmission());
94  }
95  }
96  return interferingTransmissions;
97 }
std::vector< TransmissionCacheEntry > transmissionCache
Definition: ReferenceCommunicationCache.h:30
virtual const IInterference* inet::physicallayer::ReferenceCommunicationCache::getCachedInterference ( const IRadio receiver,
const ITransmission transmission 
)
inlineoverridevirtual

Reimplemented from inet::physicallayer::CommunicationCacheBase.

65 { return nullptr; }
virtual const INoise* inet::physicallayer::ReferenceCommunicationCache::getCachedNoise ( const IRadio receiver,
const ITransmission transmission 
)
inlineoverridevirtual

Reimplemented from inet::physicallayer::CommunicationCacheBase.

66 { return nullptr; }
virtual const IReception* inet::physicallayer::ReferenceCommunicationCache::getCachedReception ( const IRadio radio,
const ITransmission transmission 
)
inlineoverridevirtual

Reimplemented from inet::physicallayer::CommunicationCacheBase.

64 { return nullptr; }
virtual const IReceptionDecision* inet::physicallayer::ReferenceCommunicationCache::getCachedReceptionDecision ( const IRadio radio,
const ITransmission transmission,
IRadioSignal::SignalPart  part 
)
inlineoverridevirtual

Reimplemented from inet::physicallayer::CommunicationCacheBase.

68 { return nullptr; }
virtual const ISNIR* inet::physicallayer::ReferenceCommunicationCache::getCachedSNIR ( const IRadio receiver,
const ITransmission transmission 
)
inlineoverridevirtual

Reimplemented from inet::physicallayer::CommunicationCacheBase.

67 { return nullptr; }
ReferenceCommunicationCache::RadioCacheEntry * inet::physicallayer::ReferenceCommunicationCache::getRadioCacheEntry ( const IRadio radio)
overrideprotectedvirtual

Implements inet::physicallayer::CommunicationCacheBase.

36 {
37  int radioId = radio->getId();
38  if ((int)radioCache.size() < radioId)
39  radioCache.resize(radioId);
40  return &radioCache[radioId];
41 }
std::vector< RadioCacheEntry > radioCache
Definition: ReferenceCommunicationCache.h:31
ReferenceCommunicationCache::ReceptionCacheEntry * inet::physicallayer::ReferenceCommunicationCache::getReceptionCacheEntry ( const IRadio radio,
const ITransmission transmission 
)
overrideprotectedvirtual

Implements inet::physicallayer::CommunicationCacheBase.

55 {
56  TransmissionCacheEntry *transmissionCacheEntry = getTransmissionCacheEntry(transmission);
57  std::vector<ReceptionCacheEntry> *receptionCacheEntries = static_cast<std::vector<ReceptionCacheEntry> *>(transmissionCacheEntry->receptionCacheEntries);
58  int radioId = radio->getId();
59  if ((int)receptionCacheEntries->size() < radioId)
60  receptionCacheEntries->resize(radioId);
61  return &(*receptionCacheEntries)[radioId];
62 }
virtual TransmissionCacheEntry * getTransmissionCacheEntry(const ITransmission *transmission) override
Definition: ReferenceCommunicationCache.cc:43
ReferenceCommunicationCache::TransmissionCacheEntry * inet::physicallayer::ReferenceCommunicationCache::getTransmissionCacheEntry ( const ITransmission transmission)
overrideprotectedvirtual

Implements inet::physicallayer::CommunicationCacheBase.

Referenced by getReceptionCacheEntry().

44 {
45  int transmissionId = transmission->getId();
46  if ((int)transmissionCache.size() < transmissionId)
47  transmissionCache.resize(transmissionId);
48  TransmissionCacheEntry *transmissionCacheEntry = &transmissionCache[transmissionId];
49  if (transmissionCacheEntry->receptionCacheEntries == nullptr)
50  transmissionCacheEntry->receptionCacheEntries = new std::vector<ReceptionCacheEntry>(radioCache.size());
51  return transmissionCacheEntry;
52 }
std::vector< RadioCacheEntry > radioCache
Definition: ReferenceCommunicationCache.h:31
std::vector< TransmissionCacheEntry > transmissionCache
Definition: ReferenceCommunicationCache.h:30
virtual std::ostream& inet::physicallayer::ReferenceCommunicationCache::printToStream ( std::ostream &  stream,
int  level 
) const
inlineoverridevirtual

Prints this object to the provided output stream.

Function calls to operator<< with pointers or references either const or not are all forwarded to this function.

Reimplemented from inet::physicallayer::IPrintableObject.

45 { return stream << "ReferenceCommunicationCache"; }
void inet::physicallayer::ReferenceCommunicationCache::removeNonInterferingTransmissions ( )
overridevirtual
void inet::physicallayer::ReferenceCommunicationCache::removeRadio ( const IRadio radio)
overridevirtual
void inet::physicallayer::ReferenceCommunicationCache::removeTransmission ( const ITransmission transmission)
overridevirtual

Member Data Documentation

std::vector<RadioCacheEntry> inet::physicallayer::ReferenceCommunicationCache::radioCache
protected
std::vector<TransmissionCacheEntry> inet::physicallayer::ReferenceCommunicationCache::transmissionCache
protected

The documentation for this class was generated from the following files: