CodeSubWars 0.4.7b
CodeSubWars::CSWTransceiver Class Reference

#include <CSWTransceiver.h>

Inheritance diagram for CodeSubWars::CSWTransceiver:

Public Member Functions

int getMaxNumQueuedMessages () const
int getNumQueuedMessages () const
void send (const std::string &strMessage)
std::string getFirstReceived ()
- Public Member Functions inherited from CodeSubWars::CSWEquipment
bool isMoving () const
- Public Member Functions inherited from CodeSubWars::CSWObject
const std::string & getName () const

Detailed Description

This class encapsulates transceiver functionality. With this you can send and receive broadcast messages. The last 100 received text messages are queued until they fetched with getFirstReceived.

Member Function Documentation

◆ getFirstReceived()

std::string CodeSubWars::CSWTransceiver::getFirstReceived ( )

Returns the first (the oldest in the queue) received text and removes it from internal queue. If no text is available "" is returned.

◆ getMaxNumQueuedMessages()

int CodeSubWars::CSWTransceiver::getMaxNumQueuedMessages ( ) const

Returns the maximal number of messages that will be queued.

◆ getNumQueuedMessages()

int CodeSubWars::CSWTransceiver::getNumQueuedMessages ( ) const

Returns the current queued number of messages.

◆ send()

void CodeSubWars::CSWTransceiver::send ( const std::string &  strMessage)

Sends a given text to all eventdealable objects within the world, but not to itself.

strMessageThe text that should be sent.

Generated at Sun Aug 7 2022 for project CodeSubWars.