#include <sxPacketHeader.h>
Public Member Functions | |
sxPacketHeader () | |
Construct empty data descriptor. | |
sxPacketHeader (const sxPacketHeader &desc) | |
Construct copy object. | |
sxPacketHeader & | operator= (const sxPacketHeader &desc) |
assign descriptor object | |
QString | ToString () const |
convert map to string | |
void | FromString (const QString &str, bool clearOld=true) |
map from string | |
void | Serialize (QDataStream &ds) const |
void | Deserialize (QDataStream &ds) |
bool | Merge (const sxPacketHeader &desc) |
Merge the descriptor into this. | |
sxPacketHeader * | Clone () const |
return clone of this object | |
void | Clear () |
Clear descriptor item(s). | |
size_t | Size () const |
Get number of item(s). | |
bool | Contains (const QString &key) const |
Test if this descriptor contains key. | |
bool | IsEmpty () const |
Check if this is empty descriptor or not. | |
void | Remove (const QString &key) |
Remove item with given key. | |
void | Set (const QString &key, const QVariant &value) |
Set descriptor with given key and value. | |
QVariant | Get (const QString &key, const QVariant &defaultValue=QVariant()) const |
Get descriptor value associated with key. |
sxPacketHeader::sxPacketHeader | ( | const sxPacketHeader & | desc | ) | [explicit] |
bool sxPacketHeader::Contains | ( | const QString & | key | ) | const |
Test if this descriptor contains key.
key | descriptor key to be test |
QVariant sxPacketHeader::Get | ( | const QString & | key, | |
const QVariant & | defaultValue = QVariant() | |||
) | const |
Get descriptor value associated with key.
key | key of the descriptor | |
defaultValue | default value if not exists |
Referenced by sxComponent::OnEvaluate().
bool sxPacketHeader::Merge | ( | const sxPacketHeader & | desc | ) |
Merge the descriptor into this.
If same key is already exists, the value will be overwriten.
References xValues.
sxPacketHeader & sxPacketHeader::operator= | ( | const sxPacketHeader & | desc | ) |
void sxPacketHeader::Remove | ( | const QString & | key | ) |
Remove item with given key.
key | key item to be removed |
void sxPacketHeader::Set | ( | const QString & | key, | |
const QVariant & | value | |||
) |
Set descriptor with given key and value.
If descriptor with same key already exists, value will be overwritten.
key | descriptor key | |
value | descriptor value |
Referenced by FromString().