sxPacketHeader Class Reference

text map base packet header More...

#include <sxPacketHeader.h>

List of all members.

Public Member Functions

 sxPacketHeader ()
 Construct empty data descriptor.
 sxPacketHeader (const sxPacketHeader &desc)
 Construct copy object.
sxPacketHeaderoperator= (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.
sxPacketHeaderClone () 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.


Detailed Description

text map base packet header

Constructor & Destructor Documentation

sxPacketHeader::sxPacketHeader ( const sxPacketHeader desc  )  [explicit]

Construct copy object.

Parameters:
desc descriptor

References xValues.


Member Function Documentation

bool sxPacketHeader::Contains ( const QString &  key  )  const

Test if this descriptor contains key.

Parameters:
key descriptor key to be test
Returns:
true if key exists

QVariant sxPacketHeader::Get ( const QString &  key,
const QVariant &  defaultValue = QVariant() 
) const

Get descriptor value associated with key.

Parameters:
key key of the descriptor
defaultValue default value if not exists
Returns:
descriptor value or 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  ) 

assign descriptor object

Parameters:
desc descriptor

References xValues.

void sxPacketHeader::Remove ( const QString &  key  ) 

Remove item with given key.

Parameters:
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.

Parameters:
key descriptor key
value descriptor value

Referenced by FromString().


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

Generated on Wed Dec 17 19:30:47 2008 for xBCI API by  doxygen 1.5.7.1