kopete/protocols/messenger/libpapillon
Papillon::MessengerCoreProtocol Class Reference
#include <Papillon/MessengerCoreProtocol>

Detailed Description
Translate raw data into NetworkMessage The sole purpose of this class is to parse in a low-level way the Messenger protocol.it create NetworkMessage that Task will be able to use.
Definition at line 44 of file messengercoreprotocol.h.
Public Types | |
| enum | State { NeedMore, Available, NoData, WaitForPayload } |
Signals | |
| void | outgoingData (const QByteArray &data) |
| void | incomingData () |
Public Member Functions | |
| MessengerCoreProtocol () | |
| virtual | ~MessengerCoreProtocol () |
| void | reset () |
| void | addIncomingData (const QByteArray &incomingBytes) |
| NetworkMessage * | incomingNetworkMessage () |
| void | outgoingNetworkMessage (NetworkMessage *outgoing) |
| int | state () |
Protected Member Functions | |
| bool | okToProceed (const QDataStream &din) |
| int | rawToNetworkMessage (const QByteArray &raw) |
| bool | isPayloadCommand (const QString &command) |
Member Enumeration Documentation
State is used internally to tell where we are in the parsing.
- Enumerator:
-
NeedMore Need more data to proceed. Available NetworkMessage is ready. NoData No data is currently in for proceeding. WaitForPayload We parsed a payload command and we are waiting for payload data.
Definition at line 51 of file messengercoreprotocol.h.
Constructor & Destructor Documentation
| Papillon::MessengerCoreProtocol::MessengerCoreProtocol | ( | ) |
| Papillon::MessengerCoreProtocol::~MessengerCoreProtocol | ( | ) | [virtual] |
Member Function Documentation
| void Papillon::MessengerCoreProtocol::reset | ( | ) |
| void Papillon::MessengerCoreProtocol::addIncomingData | ( | const QByteArray & | incomingBytes | ) |
Add data to be proceeded by this class.
Accept data from the network, and buffer it into a useful message This requires parsing out each packet from the incoming data
- Parameters:
-
incomingBytes Raw data
Definition at line 69 of file messengercoreprotocol.cpp.
| NetworkMessage * Papillon::MessengerCoreProtocol::incomingNetworkMessage | ( | ) |
Get the current NetworkMessage available.
Use incomingData() to tell when get the incoming NetworkMessage.
- Returns:
- the incoming NetworkMessage or 0 if none is available.
Definition at line 94 of file messengercoreprotocol.cpp.
| void Papillon::MessengerCoreProtocol::outgoingNetworkMessage | ( | NetworkMessage * | outgoing | ) |
Convert a request into an outgoing networkMessage Emit outgoingData() with the raw networkMessage.
- Parameters:
-
outgoing NetworkMessage
Definition at line 107 of file messengercoreprotocol.cpp.
| int Papillon::MessengerCoreProtocol::state | ( | ) |
Get the state of the protocol.
- Returns:
- Current state
- See also:
- State
Definition at line 64 of file messengercoreprotocol.cpp.
| void Papillon::MessengerCoreProtocol::outgoingData | ( | const QByteArray & | data | ) | [signal] |
Emitted as the core protocol converts fields to wire ready data.
- Parameters:
-
data Outgoing raw data
| void Papillon::MessengerCoreProtocol::incomingData | ( | ) | [signal] |
Emitted when there is incoming data, parsed into a NetworkMessage.
| bool Papillon::MessengerCoreProtocol::okToProceed | ( | const QDataStream & | din | ) | [protected] |
Check that there is data to read, and set the protocol's state if there isn't any.
- Parameters:
-
din Currently used QDataStream
Definition at line 230 of file messengercoreprotocol.cpp.
| int Papillon::MessengerCoreProtocol::rawToNetworkMessage | ( | const QByteArray & | raw | ) | [protected] |
Convert incoming raw data into a NetworkMessage object and queue it.
- Parameters:
-
raw raw data
- Returns:
- number of bytes from the input that were parsed into a NetworkMessage
Definition at line 114 of file messengercoreprotocol.cpp.
| bool Papillon::MessengerCoreProtocol::isPayloadCommand | ( | const QString & | command | ) | [protected] |
Check if the command is a payload command.
- Parameters:
-
command command to check.
Definition at line 241 of file messengercoreprotocol.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference